I think this can be converted into Dijkstra's algorithm to find the minimum
distance between the start and end points. (the weights would be negative
of the points between two cells).
On Mon, Apr 29, 2013 at 4:12 PM, sreekanth guru wrote:
>
> Problem:
>
> We have m * n grids. Each grid can have
I think I would start by finding the minimum distance between each
pair of mines and use that to build a graph where the weight of edge A-
>B is the value of B minus the cost to get there from A. Finding the
maximum cycle in a graph is NP-hard. A greedy algorithm may give a
reasonably good solution
Round 1:
1.Design a Data Structure supporting 3 queries a)push b)pop c) find
minimum
2.Given post order of a BST find whether each node of the tree(except
leaf) has only 1 child or not.
eg5
\
7
/
3
/
2
is correct as e