Given a binary search tree, write a function to find the kth smallest element in the tree.
Input : 2 / \ 1 3 and k = 2 Return : 2 As 2 is the second smallest element in the tree.
NOTE : You may assume
1 <= k <= Total number of nodes in BST
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.