LeetCode --- 25. Reverse Nodes in k-Group Jan 29, 2015

 Tags LeetCode , C++ , 链表

题目链接:Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple ... More »

0条评论

LeetCode --- 24. Swap Nodes in Pairs Jan 28, 2015

 Tags LeetCode , C++ , 链表

题目链接:Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2-&... More »

0条评论

LeetCode --- 23. Merge k Sorted Lists Jan 28, 2015

 Tags LeetCode , C++ , 分治 , 链表 ,

题目链接:Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.这道题的要求是将k个有序链表合并成1个有序链表,并分析其复杂度。 暴力合并 ... More »

0条评论

LeetCode --- 22. Generate Parentheses Jan 28, 2015

 Tags LeetCode , C++ , 回溯 , 字符串

题目链接:Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution se... More »

0条评论

LeetCode --- 21. Merge Two Sorted Lists Jan 27, 2015

 Tags LeetCode , C++ , 链表

题目链接:Merge Two Sorted ListsMerge 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 lists... More »

0条评论

LeetCode --- 20. Valid Parentheses Jan 27, 2015

 Tags LeetCode , C++ , , 字符串

题目链接:Valid ParenthesesGiven a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in ... More »

0条评论

LeetCode --- 19. Remove Nth Node From End of List Jan 27, 2015

 Tags LeetCode , C++ , 链表 , 双指针

题目链接:Remove Nth Node From End of ListGiven a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->... More »

0条评论

LeetCode --- 18. 4Sum Jan 26, 2015

 Tags LeetCode , C++ , 数组 , Hash表 , 双指针

题目链接:4SumGiven 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 which gives ... More »

0条评论

LeetCode --- 17. Letter Combinations of a Phone Number Jan 26, 2015

 Tags LeetCode , C++ , 回溯 , 字符串

题目链接:Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (... More »

0条评论

LeetCode --- 16. 3Sum Closest Jan 25, 2015

 Tags LeetCode , C++ , 数组 , 双指针

题目链接:3Sum ClosestGiven an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers.... More »

0条评论