- 博客(6)
- 资源 (8)
- 收藏
- 关注
原创 Reverse Words in a String
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". #include #include #include using namespace std; /* 1. 空
2014-03-18 23:51:54 437
原创 Evaluate Reverse Polish Notation | leetcode
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 expre
2013-11-28 21:37:16 763
原创 Max Points on a Line | leetcode
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 以每个点为中心,然后遍历剩余点,找到所有的斜率,如果斜率相同,那么一定共线,每次更新最大点数,最后就是结果。排序O(nlog(n))再乘以n个点,总复杂度O(n2logn)
2013-11-24 12:24:49 1331 2
原创 Sort List | leetcode
Sort List My Submissions Sort a linked list in O(n log n) time using constant space complexity. Discuss {:CODE:73149}
2013-11-17 18:22:20 1229 1
原创 LRU Cache | leetcode
LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be posi
2013-11-11 10:15:35 722
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人