Implemented validating a binary tree