maximum depth of binary tree javascript