August 2020
Intermediate to advanced
508 pages
11h 53m
English
Here, again, is a binary search tree:

The algorithm for searching within a binary search tree is as follows:
Designate a node to be the “current node.” (At the beginning of the algorithm, the root node is the first “current node.”)
Inspect the value at the current node.
If we’ve found the value we’re looking for, great!
If the value we’re looking for is less than the current node, search for it in its left subtree.
If the value we’re looking for is greater than the current node, search for it in its right subtree.
Repeat Steps 1 through 5 until we find the value we’re searching for, or until we hit the bottom of the tree, in which case ...
Read now
Unlock full access