stylistic:tone
Iterative search

The recursive version of the search can be "unrolled" into a while loop. On most machines, the iterative version is found to be more efficient.

Since the search may proceed till some leaf node, the running time complexity of BST search is O (h) {\displaystyle O(h)} where h {\displaystyle h} is the height of the tree. However, the worst case for BST search is O (n) {\displaystyle O(n)} where n {\displaystyle n} is the total number of nodes in the BST, because an unbalanced BST may degenerate to a linked list. However, if the BST is height-balanced the height is O (log n) {\displaystyle O(\log n)}.