摘要:
题目: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: But the 阅读全文
摘要:
题目: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identic 阅读全文
摘要:
题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space ... 阅读全文
摘要:
题目: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: 链接:http://leetcode.com/problems/vali 阅读全文
摘要:
题目:Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens... 阅读全文
摘要:
题目: Given 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 unique 阅读全文
摘要:
题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should return 阅读全文
摘要:
题目: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,3,2]. 链接: http://leetco 阅读全文
摘要:
题目: Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135", return 阅读全文
摘要:
题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3 阅读全文