Q1
Maximum distance with 50 bikes and a tank of capacity 100 kms
Q2
Maximize probability of picking a pen of a given color
Q3
Tree - Save and Reconstruct
Q4
Complexity of build-heap procedure.
Q5
How to find all unique triplets in the set which gives the sum of zero?
For example, given set S = {-1 0 1 2 -1 -4},
One possible solution set is:
(-1, 0, 1)
(-1, 2, -1)
Note that (0, 1, -1) is not part of the solution above, because (0, 1, -1) is the duplicate of (-1, 0, 1). Same with (-1, -1, 2).
For a set S, there is probably no "the" solution, another solution could be:
(0, 1, -1)
(2, -1, -1)
Q6
Print a matrix in a spiral order.
Q7
Q8
How to print all edge nodes of a complete binary tree anti-clockwise?
That is all the left most nodes starting at root, then the leaves left to right and finally all the rightmost nodes.
In other words, print the boundary of the tree.
Q9
How will you print a string in reverse order, using only putchar and nothing else.
Q10