Help explain successor binary search tree code

Please support our C++ advertiser: Intel Parallel Studio Home
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

 
0
  #1
Mar 24th, 2009
Binary Search tree help
Can somebody explain to me what this code is doing step by step?, thanks
  1.  
  2. TREE-SUCCESSOR(x)
  3. 1 if right[x] ≠ NIL
  4. 2 then return TREE-MINIMUM (right[x])
  5. 3 y ← p[x]
  6. 4 while y ≠ NIL and x = right[y]
  7. 5 do x ← y
  8. 6 y ← p[y]
  9. 7 return y
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,462
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Help explain successor binary search tree code

 
0
  #2
Mar 24th, 2009
have no idea because it isn't c or c++.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 109
Reputation: SeeTheLite is an unknown quantity at this point 
Solved Threads: 12
SeeTheLite SeeTheLite is offline Offline
Junior Poster

Re: Help explain successor binary search tree code

 
0
  #3
Mar 24th, 2009
Looks like lua
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 C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC