take this example
let the gaurds demand be
5 2 7 2 9
first guard : we have no choice but to give him 5
second guard : we have choice , either skip him and pay 7 to next guard or
pay him and save 7 from third guard .. thus clearly multiple solutions
exist but we have to give optimal one. { hint
yeah true . one interesting thing I noticed is that if you run this code
#includestdio.h
int main()
{
int i = 0;
do {
printf (%d\n,(float)1);
}while(i++ 1);
return 0;
}
one would expect same output in both the rows but surprisingly it came
different for me every time .
output for me for the previous snippet
localhost:slingshot rohitjangid$ ./a.out
1799476872
1799474584
localhost:slingshot rohitjangid$ ./a.out
1710327432
1710325144
localhost:slingshot rohitjangid$ ./a.out
1856128648
1856126360
localhost:slingshot rohitjangid$ ./a.out
1724065416
1724063128
On
Q1. Given a log file, pirnt last n lines. Note that the Log file is being
written into.
Q2. Implement Circular Buffer.
Best Regards
Ashish Goel
Think positive and find fuel in failure
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To