LeetCode --- 103. Binary Tree Zigzag Level Order Traversal Mar 13, 2015

 Tags LeetCode , C++ , , 广度优先搜索 ,

题目链接:Binary Tree Zigzag Level Order TraversalGiven a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to ... More »

0条评论

LeetCode --- 102. Binary Tree Level Order Traversal Mar 12, 2015

 Tags LeetCode , C++ , , 广度优先搜索

题目链接:Binary Tree Level Order TraversalGiven a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:... More »

0条评论

LeetCode --- 101. Symmetric Tree Mar 11, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / ... More »

0条评论

LeetCode --- 100. Same Tree Mar 11, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and t... More »

0条评论

LeetCode --- 99. Recover Binary Search Tree Mar 10, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using ... More »

0条评论

LeetCode --- 98. Validate Binary Search Tree Mar 10, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows: The left subtree of a nod... More »

0条评论

LeetCode --- 97. Interleaving String Mar 10, 2015

 Tags LeetCode , C++ , 动态规划 , 字符串

题目链接:Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = “aabcc”,s2 = “dbbca”,When s3 = “aadbbcbcac”... More »

0条评论

LeetCode --- 96. Unique Binary Search Trees Mar 9, 2015

 Tags LeetCode , C++ , , 动态规划

题目链接:Unique Binary Search TreesGiven n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example,Given n = 3, there are a total of 5 ... More »

0条评论

LeetCode --- 95. Unique Binary Search Trees II Mar 9, 2015

 Tags LeetCode , C++ , , 动态规划

题目链接:Unique Binary Search Trees IIGiven n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example,Given n = 3, your program sho... More »

0条评论

LeetCode --- 94. Binary Tree Inorder Traversal Mar 8, 2015

 Tags LeetCode , C++ , , Hash表 ,

题目链接:Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes’ values.For example:Given binary tree {1,#,2,3}, 1 \ 2 ... More »

0条评论