ashi
BAN USER
Comments (5)
Reputation -10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
Lets say the points are (a1,b1) (a2,b2) (a3,b3) (a4,b4) (a5,b5), Construct Bindary Tree Either on min values(a1,a2,a3,a4,a5) or max values( b1,b2,b3,b4,b5), and add another field range which will be ri = bi-ai, Insert this in each tree node,
Now compare given point's min value in the Binray tree.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Can the oldest friend change in the case of current oldest friend gets removed from friend list,
- ashi January 29, 2014If so,
need to maintain timestamp or some counter like # of friends along with list of friends.
Otherwise, it is oldest friend is like a primary key for a person, can be stored.