Intrinsic interview question

Implement and rebalance a tree structure