[algogeeks] Google puzzles

2011-03-16 Thread may.I.answer
In a sports contest there were m medals awarded on n successive days (n > 1). 1. On the first day 1 medal and 1/7 of the remaining m - 1 medals were awarded. 2. On the second day 2 medals and 1/7 of the now remaining medals was awarded; and so on. 3. On the nth and last day, the

[algogeeks] Amazon Interview question

2011-02-06 Thread may.I.answer
If [a1,a2,a3...,an,b1,b2...bn] is given input change this to [a1,b1,a2,b2.an,bn] -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email

[algogeeks] Puzzle

2011-01-26 Thread may.I.answer
You have four numbers 1 , 1 , 9 ,9 . Now using these four and operator + , - , * ,/ and parentheses(if required) your have to get 10. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups

[algogeeks] Re: Amazon Question

2011-01-26 Thread may.I.answer
Well the solution is pretty simple. What you have to do is just do inoder traversal of tree in reverse order. Here goes my C++ code for that int ith_order(Tree *root,int i) { static int c; static int ans; if(root) { ith_order(root->right,i);