摘要:
题目:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains onl... 阅读全文
摘要:
题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space ... 阅读全文
摘要:
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical... 阅读全文