码迷,mamicode.com
首页 >  
搜索关键字:leedcode    ( 225个结果
[leedcode 24] Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:其他好文   时间:2015-07-08 14:32:36    阅读次数:92
[leedcode 22] Generate Parentheses
public class Solution { //卡特兰数,一共有C2n^n-C2n^n-1种组合数 //本题的递归非常经典,需要多看牢记 List res; StringBuilder seq; public List generateParenthesis(int...
分类:其他好文   时间:2015-07-08 00:24:55    阅读次数:110
[leedcode 23] Merge k Sorted Lists
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */public...
分类:其他好文   时间:2015-07-08 00:14:36    阅读次数:152
[leedcode 20] Valid Parentheses
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:其他好文   时间:2015-07-07 18:48:56    阅读次数:99
[leedcode 18] 4Sum
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:其他好文   时间:2015-07-07 16:38:17    阅读次数:86
[leedcode 19]Remove Nth Node From End of List
Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re...
分类:其他好文   时间:2015-07-07 16:17:41    阅读次数:102
[leedcode 17] Letter Combinations of a Phone Number
public class Solution { public List res; public StringBuilder seq; public List letterCombinations(String digits) { //本题类似于全排列的变形,全排列的每...
分类:其他好文   时间:2015-07-07 14:28:47    阅读次数:123
[leedcode 16] 3Sum Closest
Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m...
分类:其他好文   时间:2015-07-07 12:48:06    阅读次数:128
[leedcode 16]
Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m...
分类:其他好文   时间:2015-07-07 12:22:55    阅读次数:113
[leedcode 15] 3Sum
public class Solution { public List> threeSum(int[] nums) { //本题需要对重复数字进行考虑,主要涉及以下几处: //1.外层循环时,需要与前一个数进行比较,如果重复,使用 if 和continue ...
分类:其他好文   时间:2015-07-07 00:37:35    阅读次数:140
225条   上一页 1 ... 19 20 21 22 23 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!