摘要:
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 co
阅读全文
posted @ 2025-03-27 23:17
ZhangZhihuiAAA
阅读(8)
推荐(0)
摘要:
Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: Input:
阅读全文
posted @ 2025-03-27 21:03
ZhangZhihuiAAA
阅读(17)
推荐(0)
摘要:
Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer
阅读全文
posted @ 2025-03-27 20:47
ZhangZhihuiAAA
阅读(4)
推荐(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 lowes
阅读全文
posted @ 2025-03-27 19:46
ZhangZhihuiAAA
阅读(14)
推荐(0)
摘要:
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear i
阅读全文
posted @ 2025-03-27 16:58
ZhangZhihuiAAA
阅读(23)
推荐(0)