Re: [algogeeks] help with o/p why 0 comes???

2013-03-04 Thread Shubham Sandeep
on my system every time o/p is 0 using ubuntu 10.04 ,gcc compiler On Mon, Mar 4, 2013 at 7:34 AM, rohit jangid rohit.nsi...@gmail.com wrote: output for me for the previous snippet localhost:slingshot rohitjangid$ ./a.out 1799476872 1799474584 localhost:slingshot rohitjangid$ ./a.out

Re: [algogeeks] help with o/p why 0 comes???

2013-03-04 Thread rohit jangid
yup , it is showing 0 0 on ideone as well . so my gcc compiler is i686-apple-darwin11-llvm-gcc-4.2. that can be the reason . from here it appears 0 is just a coincidence and it depends on compiler implementation . C doesn't define any such behavior. On Mon, Mar 4, 2013 at 3:45 PM, Shubham

Re: [algogeeks] help with o/p why 0 comes???

2013-03-04 Thread Anurag Sharma
Ya, its looking like the problem of 'i686-apple-darwin11-llvm-gcc-4.2'. For me as well it shows different outputs. On Mon, Mar 4, 2013 at 4:45 PM, rohit jangid rohit.nsi...@gmail.com wrote: yup , it is showing 0 0 on ideone as well . so my gcc compiler is i686-apple-darwin11-llvm-gcc-4.2.

Re: [algogeeks] MS Question:WAP to print last n lines of a log file

2013-03-04 Thread Anurag Sharma
Both questions look related to me. If the log file is being updated as well simultaneously, you should be able to use Circular queue/buffer for that. On Mon, Mar 4, 2013 at 9:10 AM, Ashish Goel ashg...@gmail.com wrote: Q1. Given a log file, pirnt last n lines. Note that the Log file is being

Re: [algogeeks] MS Question:WAP to print last n lines of a log file

2013-03-04 Thread Karthikeyan V.B
int main() { int n=10; coutEnter the value of n:; cinn; int i=0; ifstream file(C:\\Users\\kvb\\Desktop\\sample.txt); string line; string buffer[n]; if(file.is_open()) { while(file.good()) { getline(file,line);

[algogeeks] Print tree node which sum

2013-03-04 Thread marti
Given a value , print two nodes that sum to the value in a BST and normal tree.. time:O(n), space O(logn). -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To unsubscribe from this group and stop receiving emails from it, send an email to