[algogeeks] Re: [algogeeks]

2009-02-14 Thread mohamad mehdi kharatizadeh
This would be the case of binary heaps, not binary search trees. And also if a given node X that does not have any right child, may have a successor, consider the minimum element of a given binary search tree T, that would be the leftmost node in the tree T, it is a leaf and thus it does not have

[algogeeks] Re: [algogeeks]

2009-02-13 Thread mohamad mehdi kharatizadeh
Considering binary search trees(of any kind) following pseudo code will help, a successor of a node having a right child is the minimum element in the subtree rooted at that node's right child, and if that node does not have any right child, then you have to find the successor that would be one of