With all integer numbers from 1-n, any combination of numbers of 1-Sn can be formed where Sn is the sum of numbers from 1-n. Hence, with number set [1,2,3,4,5], the numbers 1-15 can be formed by summing a combination of numbers.
In order traversal of a binary search tree would result in an ordered array. Hence when a BST is traversed in order, the resulting array would be sorted. This can be used to find X largest or least element.
Uses maxReach, decrement steps and update steps=maxReach-index when steps==0.