
LeetCode
一MasonChen
这个作者很懒,什么都没留下…
展开
-
[LeetCode] evaluate-reverse-polish-notation
evaluate-reverse-polish-notation题目描述Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another expression. Some e原创 2016-08-12 21:16:02 · 276 阅读 · 0 评论 -
[LeetCode] max-points-on-a-line
max-points-on-a-line题目描述Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 给出n个点的坐标,找出在一条线上的点的数量的最大值. 根据斜率统计在一条直线上的点的数量,可以用HashMap作为斜率和数量的映射原创 2016-08-12 21:37:20 · 345 阅读 · 0 评论 -
[LeetCode] sort-list
sort-list 题目描述Sort a linked list in O(n log n) time using constant space complexity. 链表排序。。要求用O(n log n)的复杂度。好像只有归并排序比较适合 把链表分成两部分的时候用快慢指针:当快指针遍历结束后,慢指针刚到中间。 /** * Definition for singly-linked原创 2016-08-12 21:48:47 · 342 阅读 · 0 评论