Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
/**
* Definition for binary tree
* struct TreeNode {
...
分类:
其他好文 时间:
2014-10-06 14:46:30
阅读次数:
202
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
/**
* Definition for binary tree
* struct TreeNode {...
分类:
其他好文 时间:
2014-10-06 14:45:50
阅读次数:
178
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-10-06 13:11:00
阅读次数:
167
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial...
分类:
其他好文 时间:
2014-10-05 13:53:58
阅读次数:
163
[leetcode]Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring....
分类:
其他好文 时间:
2014-10-02 13:30:42
阅读次数:
217
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
面DP题的考官都是神经病。。(吐...
分类:
其他好文 时间:
2014-10-01 13:15:31
阅读次数:
242
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-09-30 17:19:19
阅读次数:
173
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题意:知道二叉树的前序遍历和中...
分类:
其他好文 时间:
2014-09-29 23:47:51
阅读次数:
265
题目:
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in t...
分类:
其他好文 时间:
2014-09-25 21:12:57
阅读次数:
148
Given 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 node contains only n...
分类:
其他好文 时间:
2014-09-19 04:28:05
阅读次数:
247