To find the successor of x in a BST

View previous topic View next topic Go down

To find the successor of x in a BST

Post  Admin on Mon Sep 12, 2011 3:14 pm

The last left turn is the successor(x):

public E successor(E x){
return succAux(root, x, null);

public E succAux(Node root, E x, E best){
return best;
int c=x.compartTo(root);
return succAux(root.right, X, best);
return succAux(root.l, X, root.v);


Posts : 131
Join date : 2011-08-16

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum