摘要: 1 """ 2 Given a binary tree, return the inorder traversal of its nodes' values. 3 Example: 4 Input: [1,null,2,3] 5 1 6 \ 7 2 8 / 9 3 10 Output: [1,3,2 阅读全文
posted @ 2020-02-13 22:20 yawenw 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 We are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1. 3 Return the same tree where eve 阅读全文
posted @ 2020-02-13 22:17 yawenw 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give 阅读全文
posted @ 2020-02-13 22:15 yawenw 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. 3 An example is the root-to-leaf path 1- 阅读全文
posted @ 2020-02-13 22:13 yawenw 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. 3 According to the definition of LCA on Wikipedia: 阅读全文
posted @ 2020-02-13 22:12 yawenw 阅读(99) 评论(0) 推荐(0) 编辑