UBS Interview Question

Binary tree algorithm