ZhangZhihui's Blog  
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 116 下一页

2025年3月27日

摘要: 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 阅读(20) 评论(0) 推荐(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 阅读(32) 评论(0) 推荐(0)

2025年3月26日

摘要: You are given the root of a binary tree containing digits from 0 to 9 only. Each root-to-leaf path in the tree represents a number. For example, the r 阅读全文
posted @ 2025-03-26 22:17 ZhangZhihuiAAA 阅读(14) 评论(0) 推荐(0)
 
摘要: Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the 阅读全文
posted @ 2025-03-26 17:48 ZhangZhihuiAAA 阅读(13) 评论(0) 推荐(0)
 
摘要: Given the root of a binary tree, flatten the tree into a "linked list": The "linked list" should use the same TreeNode class where the right child poi 阅读全文
posted @ 2025-03-26 12:12 ZhangZhihuiAAA 阅读(17) 评论(0) 推荐(0)
 
摘要: Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there 阅读全文
posted @ 2025-03-26 11:34 ZhangZhihuiAAA 阅读(17) 评论(0) 推荐(0)
 
摘要: Given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the 阅读全文
posted @ 2025-03-26 09:09 ZhangZhihuiAAA 阅读(16) 评论(0) 推荐(0)

2025年3月24日

摘要: 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 sa 阅读全文
posted @ 2025-03-24 22:26 ZhangZhihuiAAA 阅读(4) 评论(0) 推荐(0)
 
摘要: Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: Input: root = [1,2,2,3,4,4,3] 阅读全文
posted @ 2025-03-24 09:22 ZhangZhihuiAAA 阅读(19) 评论(0) 推荐(0)

2025年3月23日

摘要: Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initia 阅读全文
posted @ 2025-03-23 17:42 ZhangZhihuiAAA 阅读(29) 评论(0) 推荐(0)
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 116 下一页