摘要: 题目 Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node 阅读全文
posted @ 2021-10-13 15:38 你也要来一颗长颈鹿吗 阅读(28) 评论(0) 推荐(0)
摘要: 题目 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lo 阅读全文
posted @ 2021-10-13 12:28 你也要来一颗长颈鹿吗 阅读(23) 评论(0) 推荐(0)
摘要: 题目 Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the 阅读全文
posted @ 2021-10-13 10:46 你也要来一颗长颈鹿吗 阅读(22) 评论(0) 推荐(0)