binary tree and sum in array