Abstract
We recall from Chapter 3 that a binary search tree is a binary tree whose nodes hold records in such a way that for every node in the tree the key field of its information field (assumed of ordered type) is greater than that of every node in its left subtree and less than that of every node in its right subtree. Although we did not discuss the problem in Chapter 3 it is clear how to search for an item stored in a binary search tree—we compare its key with the key of the information field of the element stored at the root node (the “root key”); if they are the same then our search has been successful; if not, then we search recursively in the left or right subtree of the root according as the key of the item we are searching for is less than or greater than the root key.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.