Tejasvi Nuthalapati
BAN USER
Employee at None
Im pursuing final year Btec
Comments (4)
Reputation -5
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
here nth Smallest <==>any smallest element number Remember n value "is taken as an input frm the user like 1st,2nd,3rd,4th,......" when specified must be retrieved in LogN time GOT IT???
- Tejasvi Nuthalapati January 24, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
if he particularly insists no i want even the implementation of the tree in IN-order show it...!!
then do an inorder Traversal of the tree store it in an array and do accordingly as stated above
Comment hidden because of low score. Click to expand.
-1
of 1 vote
he said he already gave a BST, He obviously gives it in an array..!!Confirm from the interviewer that its accepted in In-order only
1.)Search for the Required node in the Array (which if found say is at i ),
2.)Nodes From (i+1---till---2i) are its Cousins
Hopefully im right!!!!
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
As he said only one element is duplicated,
- Tejasvi Nuthalapati January 24, 2013XOR all the elements of the array the remaining element after the Xor is the required duplicated element..!! :)