![]() |
| ||
| binary search trees 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? |
| ||
| Re: binary search trees 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. |
| ||
| Re: binary search trees >I am having trouble understanding what a successor is. A successor is the node with the next highest value. 6In 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. |
| All times are GMT -4. The time now is 12:51 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC