LeetCode --- 160. Intersection of Two Linked Lists Apr 19, 2015

 Tags LeetCode , C++ , 链表

题目链接:Intersection of Two Linked ListsWrite a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked... More »

0条评论

LeetCode --- 155. Min Stack Apr 17, 2015

 Tags LeetCode , C++ , , 数据结构

题目链接:Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes ... More »

0条评论

LeetCode --- 154. Find Minimum in Rotated Sorted Array II Apr 16, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Find Minimum in Rotated Sorted Array IISuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).... More »

0条评论

LeetCode --- 153. Find Minimum in Rotated Sorted Array Apr 16, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Find Minimum in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Fin... More »

0条评论

LeetCode --- 152. Maximum Product Subarray Apr 15, 2015

 Tags LeetCode , C++ , 数组 , 动态规划

题目链接:Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [... More »

0条评论

LeetCode --- 151. Reverse Words in a String Apr 14, 2015

 Tags LeetCode , C++ , 字符串

题目链接:Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = “the sky is blue”,return “blue is sky the”.Update (2015-02-1... More »

0条评论

LeetCode --- 150. Evaluate Reverse Polish Notation Apr 13, 2015

 Tags LeetCode , C++ ,

题目链接:Evaluate Reverse Polish NotationEvaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an i... More »

0条评论

LeetCode --- 149. Max Points on a Line Apr 13, 2015

 Tags LeetCode , C++ , Hash表 , 数学

题目链接:Max Points on a LineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.这道题的要求是统计二维平面上最多有多少点在同一直线上。这是一道数学的问题,而且是计算几... More »

0条评论

LeetCode --- 148. Sort List Apr 12, 2015

 Tags LeetCode , C++ , 链表 , 排序

题目链接:Sort ListSort a linked list in O(n log n) time using constant space complexity.这道题的要求是对链表进行排序,要求时间复杂度O(nlogn),并且常量空间复杂度。排序,时间复杂度要求O(nlogn),因此需要考虑分治思路的排序:归并排序或者快排。... More »

0条评论

LeetCode --- 147. Insertion Sort List Apr 11, 2015

 Tags LeetCode , C++ , 链表 , 排序

题目链接:Insertion Sort ListSort a linked list using insertion sort.这道题的要求是对链表进行插入排序。插入排序,就是和玩扑克差不多,每次拿到一张新牌,会从一侧向另一侧查找,直到找到合适位置,将其插进去,并保证手中的牌仍有续。 直接插入 而对于链表,采用同样的操作... More »

0条评论