Loading...
Engaged Employer
Return k smallest element in a tree
Anonymous
DFS inorder return first k visited nodes (using auxiliary array)
using a rather complicated recursion.
look number of values on the left of the current node, if adding this node we get k - this is the node we are looking for.
Probably a heap is the right way to go
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.