摘要: 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 @ 2019-09-05 10:53 Schwifty 阅读(154) 评论(0) 推荐(0)
摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文
posted @ 2019-09-05 09:45 Schwifty 阅读(145) 评论(0) 推荐(0)
摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL 阅读全文
posted @ 2019-09-05 01:53 Schwifty 阅读(127) 评论(0) 推荐(0)
摘要: Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any 阅读全文
posted @ 2019-09-05 01:18 Schwifty 阅读(146) 评论(0) 推荐(0)