随笔分类 -  Binary Tree

摘要: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 @ 2018-11-22 22:40 Veritas_des_Liberty 阅读(253) 评论(0) 推荐(0)
摘要:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its ne 阅读全文
posted @ 2018-11-22 22:28 Veritas_des_Liberty 阅读(270) 评论(0) 推荐(0)
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-11-22 19:08 Veritas_des_Liberty 阅读(183) 评论(0) 推荐(0)
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2018-11-22 18:04 Veritas_des_Liberty 阅读(204) 评论(0) 推荐(0)
摘要: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 given sum. N 阅读全文
posted @ 2018-11-21 22:09 Veritas_des_Liberty 阅读(209) 评论(0) 推荐(0)
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet 阅读全文
posted @ 2018-11-21 18:33 Veritas_des_Liberty 阅读(191) 评论(0) 推荐(0)
摘要:Preorder: Approach #1: Recurisive. Approach #2: Iteratively.[Java] Approach #3: Morris Traversal.[C++] Using Morris Traversal can don't use recurisive 阅读全文
posted @ 2018-11-18 18:20 Veritas_des_Liberty 阅读(232) 评论(0) 推荐(0)