码迷,mamicode.com
首页 >  
搜索关键字:assume    ( 1858个结果
[LeetCode]Construct Binary Tree from Preorder and Inorder Traversal
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-12-04 18:03:12    阅读次数:143
LeetCode[Array]: Search Insert Position
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 the array. ...
分类:其他好文   时间:2014-12-04 13:59:41    阅读次数:154
Sudoku Solver
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 be on...
分类:其他好文   时间:2014-12-04 13:53:10    阅读次数:99
[LeetCode] Sudoku Solver 解数独,递归,回溯
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 be on...
分类:其他好文   时间:2014-12-04 00:55:16    阅读次数:354
Longest Palindromic Substring[leetcode]
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-12-03 23:15:35    阅读次数:248
LeetCode[Tree]: Construct Binary Tree from Preorder and Inorder Traversal
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-12-03 21:27:24    阅读次数:172
【LeetCode】Validate Binary Search Tree 解题报告
今天CSDN博客发生异常,折腾了大半天终于发出了这篇博文。 【题目】 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 no...
分类:其他好文   时间:2014-12-03 17:14:52    阅读次数:219
[Leetcode] Sudoku Solver
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 be on...
分类:其他好文   时间:2014-12-02 15:05:17    阅读次数:182
Longest Palindromic Substring
动态规划Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longes...
分类:其他好文   时间:2014-12-01 20:48:25    阅读次数:250
【LeetCode】Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:其他好文   时间:2014-11-30 16:46:40    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!