摘要: 题目: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia:In a complete binary tree every level 阅读全文
posted @ 2017-07-24 21:58 荒野第一快递员 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For 阅读全文
posted @ 2017-07-24 20:17 荒野第一快递员 阅读(166) 评论(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  阅读全文
posted @ 2017-07-24 17:42 荒野第一快递员 阅读(196) 评论(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 阅读全文
posted @ 2017-07-24 16:45 荒野第一快递员 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to it 阅读全文
posted @ 2017-07-24 14:33 荒野第一快递员 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: 题意及分析:给出一棵树,要求给出这棵树的先序遍历组成的链表,但是 阅读全文
posted @ 2017-07-24 10:03 荒野第一快递员 阅读(174) 评论(0) 推荐(0) 编辑