binary search trees

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Mar 2008
Posts: 26
Reputation: kinger29 is an unknown quantity at this point 
Solved Threads: 1
kinger29 kinger29 is offline Offline
Light Poster

binary search trees

 
0
  #1
Mar 21st, 2008
I am trying to program in C++ a binary search tree, but I am having trouble understanding what a successor is. Can someone help me out?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 269
Reputation: sarehu is on a distinguished road 
Solved Threads: 22
sarehu's Avatar
sarehu sarehu is offline Offline
Posting Whiz in Training

Re: binary search trees

 
0
  #2
Mar 21st, 2008
That's not any sort of standard terminology. A successor is, by the English definition, the thing that comes next. For example, "the successor to the throne." You don't need to know what any terminology means, you just need to know what a binary search tree looks like in order to implement one.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,541
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 704
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: binary search trees

 
0
  #3
Mar 22nd, 2008
>I am having trouble understanding what a successor is.
A successor is the node with the next highest value.
      6
  3       8
2   5   7   9
   4
In this tree, the successor of each node is the next node that would be given in an inorder traversal. For example, the successor of 2 is 3, but the successor of 3 is 4. The successor of 5 is 6, but the successor of 6 is 7. In this way, the successor doesn't refer to the structure of the tree, but rather the contained values. The successor could be right next to the node in question or several branches away, up or down the tree.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

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



Similar Threads
Other Threads in the Computer Science Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC