![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode OJ
文章平均质量分 73
williamwyx
这个作者很懒,什么都没留下…
展开
-
Linked List Cycle
/* * Solution.cpp * * Created on: 2014年4月9日 * Author: William */#include using namespace std;// Definition for singly-linked list.struct ListNode { int val; ListNode *next; ListNod原创 2014-04-16 16:59:22 · 374 阅读 · 0 评论 -
Insertion Sort List
/* * Solution.cpp * * Created on: 2014年4月8日 * Author: William */#include using namespace std;// Definition for singly-linked list.struct ListNode { int val; ListNode *next; ListNode原创 2014-04-09 16:47:56 · 341 阅读 · 0 评论 -
Sort List
/* * Solution.cpp * * Created on: 2014年4月8日 * Author: William */#include using namespace std;// Definition for singly-linked list.struct ListNode { int val; ListNode *next; ListNod原创 2014-04-09 16:47:17 · 308 阅读 · 0 评论 -
Evaluate Reverse Polish Notation
/* * Solution.cpp * * Created on: 2014年3月25日 * Author: William */#include #include #include #include #include using namespace std;class Solution{public: int evalRPN(vector &toke原创 2014-04-09 16:45:32 · 314 阅读 · 0 评论 -
Reorder List
/* * Solution.cpp * * Created on: 2014年4月9日 * Author: William */#include using namespace std;// Definition for singly-linked list.struct ListNode { int val; ListNode *next; ListNod原创 2014-04-09 16:51:31 · 335 阅读 · 0 评论 -
Binary Tree Preorder Traversal
/* * Solution.cpp * * Created on: 2014年4月9日 * Author: William */#include #include #include using namespace std;// Definition for binary treestruct TreeNode { int val; TreeNode *le原创 2014-04-09 16:50:55 · 288 阅读 · 0 评论 -
LRU Cache
/* * Solution.cpp * * Created on: 2014年4月8日 * Author: William */#include #include using namespace std;struct Node { int key; int val; Node *prev; Node *next; Node(int k, int v) :原创 2014-04-09 16:48:28 · 353 阅读 · 0 评论 -
Max Points on a Line
/* * Solution.cpp * * Created on: 2014年3月26日 * Author: William *//** * Definition for a point. * struct Point { * int x; * int y; * Point() : x(0), y(0) {} * Point(in原创 2014-04-09 16:46:31 · 330 阅读 · 0 评论 -
Reverse Words in a String
/* * Solution.cpp * * Created on: 2014年3月25日 * Author: William */#include #include using namespace std;class Solution {public: void reverseWords(string &s) { reverse(s.begin原创 2014-04-09 16:43:34 · 315 阅读 · 0 评论 -
Word Break II
不会做啊不会做~原创 2014-04-17 14:41:18 · 434 阅读 · 0 评论 -
Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"原创 2014-04-17 14:40:49 · 341 阅读 · 0 评论 -
Linked List Cycle II
分析转自:http://www.cnblogs.com/CSGrandeur/p/3520937.html设置两个指针slow和fast,从head开始,slow一次一步,fast一次两步,如果fast能再次追上slow则有圈。设slow走了n步,则fast走了2*n步,设圈长度m,圈起点到head距离为k,相遇位置距离圈起点为t,则有:n = k + t + pm;原创 2014-04-16 16:58:52 · 406 阅读 · 0 评论 -
Binary Tree Postorder Traversal
/* * Solution.cpp * * Created on: 2014年4月9日 * Author: William */#include #include #include using namespace std;// Definition for binary treestruct TreeNode { int val; TreeNode *le原创 2014-04-09 16:49:10 · 305 阅读 · 0 评论