Amazon Interview Question

Array shifting, sorting, recursion, and trees.