6: Kth smallest node in a binary search tree

Дано непустое бинарное дерево поиска и число k. Найдите k-й наименьший элемент

 

Пример 1

Input: tree = 3   k = 1
             / \  
            2   8 

Output: 2

Пример 2

Input: tree = 3   k = 2
             / \  
            2   8 

Output: 3
Difficulty:Medium
Topic:Tree
Problem #:6