Description
On a number axis directed from the left rightwards, n marbles with coordinates
x1,?x2,?...,?xn are situated. Let's assume that the sizes of the marbles are infinitely small, that
is ...
分类:
其他好文 时间:
2014-08-06 19:11:42
阅读次数:
310
题目原文:
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-08-05 15:56:59
阅读次数:
290
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 nodes with keys less than the node's key.Th...
分类:
其他好文 时间:
2014-08-05 09:43:39
阅读次数:
191
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree./** * Definiti...
分类:
其他好文 时间:
2014-08-05 00:01:38
阅读次数:
271
Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.class Solutio...
分类:
其他好文 时间:
2014-08-04 23:57:18
阅读次数:
476
题目: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 on....
分类:
编程语言 时间:
2014-08-04 13:57:17
阅读次数:
242
题目: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 lo....
分类:
编程语言 时间:
2014-08-04 04:10:26
阅读次数:
374
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-08-01 19:53:32
阅读次数:
222
题目:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will ....
分类:
编程语言 时间:
2014-08-01 10:38:21
阅读次数:
224
题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.题解:这道题跟pre....
分类:
编程语言 时间:
2014-08-01 06:56:51
阅读次数:
185