maverick!
BAN USER
Comments (5)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
I thin we can directly take the left most are the right most.
According to me
following should be the algorithms for inorder successor and predecessor
predecessor(t)
{
if (left[t]!=NULL)
return the leftmost element in left[t];
if parent[t]-right==t
return parent(t)
else return parent(parent(t))
}
for successor
successor[t]
if right[t]!=NULL
return leftmost element in right[t]
if (t==parent(t)->right)
return parent(parent(t));
else return parent(t)
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.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
correct me if m wrong..we can calcuate all possible sums?? for all the perfect squares that are posted in the the solution...is it related to dynamic programming?
- maverick! August 27, 2011