Implementation of TreeSum
Added BinarySearchMax