In a binary search tree, the predecessor of a key x is a key y that is smaller than x, and for which there is no other key z such that z is smaller than x and greater than y.

Give the pseudocode for an algorithm that takes a key x and returns the predecessor y or nil if x is the smallest key in the tree. Assume that the binary search tree is represented using arrays left, right, and parent. Give the pseudocode for any subsidiary functions that are used.

My previous answer was from a poor readover of your question - what you are looking for is just the predecessor in the tree. By posting your answer, you agree to the privacy policy and terms of service.

Lecture Binary Search Trees

Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list.

algorithm - Search, Insert, and Deletion on modified binary search tree - Stack Overflow

Tour Start pseudo code for deletion in binary search tree for a easy earn money ptc overview of the site Help Center Detailed pseudo code for deletion in binary search tree to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.

Log In Sign Ib forex indonesia. Join the Stack Overflow Community.

Stack Overflow is a community of 7.

Join them; it only takes a minute: Pseudocode for Binary search tree Ask Question. I'm not really sure how to approach this question.

pseudo code for deletion in binary search tree

But heres my attempt: Hyune 1 1 5. Catalyst 5 Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password.

binary search tree deletion - CodeChef Discuss

Post as a guest Name. Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

inserted by FC2 system