SLB Interview Question

Make a balanced tree out of input stream