码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
#21 Merge Two Sorted Lists
题目链接:https://leetcode.com/problems/merge-two-sorted-lists/ Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two...
分类:其他好文   时间:2015-07-14 15:35:59    阅读次数:111
LeetCode(28)题解:Implement strStr()
https://leetcode.com/problems/implement-strstr/题目:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle ...
分类:其他好文   时间:2015-07-14 15:23:11    阅读次数:131
#18 4Sum
题目链接:https://leetcode.com/problems/4sum/ 依次将问题转化为3Sum、2Sum问题, 后两个问题解法见关联博文。 /** * Return an array of arrays of size *returnSize. * Note: The returned array must be malloced, assume caller calls fr...
分类:其他好文   时间:2015-07-14 13:43:05    阅读次数:109
【leetcode】20. Valid Parentheses
@requires_authorization @author johnsondu @create_time 2015.7.13 11:03 @url [valid parentheses](https://leetcode.com/problems/valid-parentheses/) /***************** * 类别: 栈模拟判断 * 时间复杂度: O(n) * 空间复杂度...
分类:其他好文   时间:2015-07-14 11:22:05    阅读次数:97
Sort Colors
https://leetcode.com/problems/sort-colors/计数排序问题 1 class Solution { 2 public: 3 void sortColors(vector& nums) { 4 int rates[3]={0}; 5 ...
分类:其他好文   时间:2015-07-14 11:16:22    阅读次数:127
Androidstudio中Rendering Problems不能可视化操作的解决办法
出现:Rendering Problemsthe following classes could not be found:android.support.v7.internal.widget.ActionBarOverlayLayout (Fix Build Path, Edit XML, Cre...
分类:移动开发   时间:2015-07-13 18:11:41    阅读次数:256
Convert Sorted Array to Binary Search Tree
https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * ...
分类:其他好文   时间:2015-07-13 17:36:27    阅读次数:79
Maximum Subarray
https://leetcode.com/problems/maximum-subarray/动态规划:用res数组来记录包含了每个点的连续数组的和的最大的情况解的情况,后续的每次计算参考前面的计算结果。 1 class Solution { 2 public: 3 int maxSubAr...
分类:其他好文   时间:2015-07-13 17:34:41    阅读次数:89
Gray Code
https://leetcode.com/problems/gray-code/ 1 class Solution { 2 public: 3 vector grayCode(int n) { 4 vector res; 5 if(n==0) 6 ...
分类:其他好文   时间:2015-07-13 15:38:50    阅读次数:95
Search a 2D Matrix
https://leetcode.com/problems/search-a-2d-matrix/ 1 class Solution { 2 public: 3 bool searchMatrix(vector>& matrix, int target) { 4 int m=...
分类:其他好文   时间:2015-07-13 15:26:33    阅读次数:93
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!