Implemented static function to test if tree is bst