摘要: 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 @ 2017-07-17 05:34 白天黑夜每日c 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2017-07-17 05:31 白天黑夜每日c 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文
posted @ 2017-07-17 05:29 白天黑夜每日c 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution sti 阅读全文
posted @ 2017-07-17 05:28 白天黑夜每日c 阅读(132) 评论(0) 推荐(0) 编辑