27 Remove Element链接:https://leetcode.com/problems/remove-element/
问题描述:
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be...
分类:
其他好文 时间:
2015-07-13 14:06:04
阅读次数:
79
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/ 1 class Solution { 2 public: 3 int findMin(vector& nums) { 4 int size=...
分类:
其他好文 时间:
2015-07-13 13:45:49
阅读次数:
118
树是二叉查找树的情况题目来自LeetCode:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
Lowest Common Ancestor of a Binary Search Tree Total Accepted: 3402 Total Submissions: 8709 My Subm...
分类:
其他好文 时间:
2015-07-13 12:10:38
阅读次数:
112
https://leetcode.com/problems/merge-two-sorted-lists/ 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ...
分类:
其他好文 时间:
2015-07-13 11:56:41
阅读次数:
113
https://leetcode.com/problems/unique-paths/递归问题转换成动态规划问题。每个问题可以分解成p[m][n]=p[m-1][n]+p[m][n-1]动态规划:做一个动态二维数组,用于存放每步的解。最终的循环就是矩阵的所有点遍历一遍。时间复杂度为m*n的矩阵遍历。...
分类:
其他好文 时间:
2015-07-13 11:43:00
阅读次数:
108
18 4Sum链接:https://leetcode.com/problems/4sum/
问题描述:
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w...
分类:
其他好文 时间:
2015-07-13 10:29:38
阅读次数:
120
125 Valid Palindrome链接:https://leetcode.com/problems/valid-palindrome/
问题描述:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For exampl...
分类:
其他好文 时间:
2015-07-13 10:17:15
阅读次数:
145
题目信息如下:
1、题目地址为:https://leetcode.com/problems/largest-rectangle-in-histogram/
2、题目意思为:
给定一个非负数组height,代表了矩形的高度(其中矩形宽度为1),求在其中能找出最大的矩形面积。
3、给的例子为: height = [2,1,5,6,2,3]. 输出为:10.示意图如下
那么...
分类:
其他好文 时间:
2015-07-12 21:43:49
阅读次数:
105
https://leetcode.com/problems/climbing-stairs/ 1 class Solution { 2 public: 3 int climbStairs(int n) { 4 if(n==1) 5 return 1; ...
分类:
其他好文 时间:
2015-07-12 17:09:48
阅读次数:
107
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/Given a binary search tree (BST), find the lowest common ancestor (LCA) o...
分类:
其他好文 时间:
2015-07-11 16:18:22
阅读次数:
127