BiTree Kth Min Value
BINARY TREE
DEPTH-FIRST SEARCH
Problem
Given the root
of a binary search tree where each node represents a score, find and return the kth smallest score.
The value of k
is 1-indexed, meaning if k
is 1, you should return the smallest score in the tree.
Example
minValue([6, 2, 8, 0, 4, null, null, null, null, null, 5], 4) // return 5
Loading...
Loading...Loading...