Kth Smallest Element in a BST with a twist
Anonymous User
1227

Given a binary search tree where each node knows its descendant count, find the kth smallest element
descendant count = number of node's children + that node's children

		Ex:                                          8(4)
		
		
											3(2)                   9(0)
											
											
									   2(0)       4(0)

Answer:
k=1->2
k=2->3
k=3->4
k=4->8
k=5->9

Comments (9)