Understanding iterative search
Iterative search also exploits the binary search property of a binary search tree and follows the same path as the recursive search algorithm. Since we know the direction we need to go at every step, the search algorithm can also be implemented iteratively using loops.
Algorithm
Let us look at a binary search tree with a value we want to search to see how to use its unique property to speed up our simple traversal search algorithm.
Liking the course? Check our discounted plans to continue learning.