[LeetCode]Validate Binary Search Tree

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 ...

2015-09-29 11:10:23

阅读数:128

评论数:0

[LeetCode] Unique Binary Search Trees(!!DP)

Unique Binary Search Trees Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n = 3,...

2015-09-27 13:38:08

阅读数:146

评论数:0

[LeetCode] Binary Tree Inorder Traversal

Binary Tree Inorder Traversal My Submissions Question Solution Total Accepted: 85535 Total Submissions: 232962 Difficulty: Medium Given a bina...

2015-09-26 22:58:56

阅读数:130

评论数:0

[LeetCode]Restore IP Addresses(!!!!BackTrace)

Restore IP Addresses My Submissions Question Solution Total Accepted: 41299 Total Submissions: 192823 Difficulty: Medium Given a string ...

2015-09-26 22:08:57

阅读数:209

评论数:0

[LeetCode] Gray Code

Gray Code My Submissions Question Solution Total Accepted: 41835 Total Submissions: 125744 Difficulty: Medium The gray code is a binary numera...

2015-09-16 20:42:05

阅读数:206

评论数:0

[LeetCode] Decode Ways(!!!DP)

Decode Ways My Submissions Question Solution Total Accepted: 47576 Total Submissions: 290697 Difficulty: Medium A message containing letters f...

2015-09-16 13:24:11

阅读数:210

评论数:0

[LeetCode] Clone Graph(!!!!graph&dfs&bfs)

Clone Graph Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ’s undirected graph serial...

2015-09-10 22:37:06

阅读数:185

评论数:0

[LeetCode] Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, ...

2015-09-09 21:13:12

阅读数:174

评论数:0

[LeetCode] Reverse Linked List II(!!!)

Reverse Linked List II Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4-&g...

2015-09-05 14:58:09

阅读数:177

评论数:0

[LeetCode] Largest Rectangle in Histogram

Largest Rectangle in Histogram Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find th...

2015-09-01 10:51:00

阅读数:203

评论数:0

[LeetCode] Maximal Square(!!!!DP优化)

定义一个D[i][j] 表示的是以i,j为右下角的最大子正方形的边长。这个边长是受限于D[i-1][j],D[i][j-1] ,D[i-1][j-1]中最小的那个的。class Solution { public: int maximalSquare(vector<vector<...

2015-08-27 20:13:28

阅读数:248

评论数:0

[LeetCode] Maximal Rectangle(!!!DP)

关于最大某某问题,使用DP思想来求解,在最大子问题系列中有较为详细的解答。 Maximal Rectangle Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containi...

2015-08-27 16:08:06

阅读数:322

评论数:0

[LeetCode] Set Matrix Zeroes (!!!!时间空间复杂度)

Set Matrix Zeroes Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up: Di...

2015-08-27 14:40:47

阅读数:251

评论数:0

[LeetCode] Edit Distance(!!!!!DP)

Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counte...

2015-08-27 11:13:30

阅读数:221

评论数:0

[LeetCode] Merge Sorted Array

Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume th...

2015-08-25 11:00:36

阅读数:224

评论数:0

[LeetCode] Partition List(!!!!巧妙的链表插入)

Partition List Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. ...

2015-08-24 21:39:29

阅读数:171

评论数:0

[LeetCode] Remove Duplicates from Sorted Array II

Remove Duplicates from Sorted Array II Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? For example, Gi...

2015-08-24 19:43:59

阅读数:191

评论数:0

[LeetCode] World Search(!!!!回溯&&char *代替string&&递归)

Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjace...

2015-08-24 15:50:27

阅读数:214

评论数:0

[LeetCode] Subsets(!!!!!回溯&&迭代&&位操作)(to be updated)

Subsets Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The...

2015-08-23 22:58:07

阅读数:405

评论数:0

[LeetCode] Combinations

Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 … n. For example, If n = 4 and k = 2, a solut...

2015-08-23 22:27:40

阅读数:170

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭