Depth First Search Algorithm (Preorder Traversal) to Compute the Kth Smallest in a Binary Search Tree
Given a binary search tree root, and k return the kth (0-indexed) smallest value in root. It is guaranteed that the tree has at least k + 1 nodes. …