Help explain successor binary search tree code thanks

Reply

Join Date: Aug 2007
Posts: 47
Reputation: Dio1080 is an unknown quantity at this point 
Solved Threads: 0
Dio1080's Avatar
Dio1080 Dio1080 is offline Offline
Light Poster

Help explain successor binary search tree code thanks

 
0
  #1
Mar 24th, 2009
Binary Search tree help
Can somebody explain to me what this code is doing step by step?, thanks
  1. TREE-SUCCESSOR(x)
  2. 1 if right[x] ≠ NIL
  3. 2 then return TREE-MINIMUM (right[x])
  4. 3 y ← p[x]
  5. 4 while y ≠ NIL and x = right[y]
  6. 5 do x ← y
  7. 6 y ← p[y]
  8. 7 return y
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,439
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 510
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Help explain successor binary search tree code thanks

 
0
  #2
Mar 24th, 2009
The code you have posted is not Java.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 47
Reputation: Dio1080 is an unknown quantity at this point 
Solved Threads: 0
Dio1080's Avatar
Dio1080 Dio1080 is offline Offline
Light Poster

Re: Help explain successor binary search tree code thanks

 
0
  #3
Mar 24th, 2009
opps
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC