![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 74
Toni-Xun
这个作者很懒,什么都没留下…
展开
-
[Leetcode Solution] Reverse Words in a String
The problem description is simple enough.For example, "the sky is blue" => "blue is sky the".However, this problem is not easy as it seems. We have to deal with the leading and trailing spaces, al原创 2014-03-17 23:29:11 · 937 阅读 · 0 评论 -
[Leetcode]Binary Tree Iterative Traversal
Three problems of binary tree traversal of Leetcode:原创 2014-04-04 22:51:45 · 610 阅读 · 0 评论 -
[Leetcode]Word Break & Word Break II
Word Break is a problem that gives you a string and a dict of word, you have to indicate that if the string原创 2014-04-18 22:55:49 · 650 阅读 · 0 评论 -
Linked List Cycle
Linked List Cycle is a problem to tell if there is a cycle in the原创 2014-04-17 21:39:56 · 586 阅读 · 0 评论 -
[Leetcode Solution]Insertion Sort List
Insertion Sort is a basic sorting algorithm invented decades ago. And the implementation is simple, too.Declare a head pointer of a sorted linked-list with initial value NULL. Then, add node to原创 2014-03-21 13:19:02 · 678 阅读 · 0 评论 -
[Leetcode Solution] Sort List
Sort a singly-linked list is easy with quick sort and merge sort algorithm. Quick sort will reach O(n ^ 2) time complexity in the worst case. Whereas merge sort is a stable sort with O(n logn) compl原创 2014-03-19 16:23:42 · 624 阅读 · 0 评论 -
[Leetcode Soution]Evaluate Reverse Polish Notation
["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6Evaluate a RPN expression is simple with a specific algorithm to deal with.STACK stack;FOR not原创 2014-03-18 14:11:18 · 605 阅读 · 0 评论 -
[Leetcode Solution]Max Points on a Line
As we know, for three arbitrary points, A, B and C, if the slope of the line equals to the slope of line, we can confirm that these three points are on a same line. Further, if line, line ... line all原创 2014-03-18 23:35:24 · 675 阅读 · 0 评论 -
[Leetcode Solution] LRU Cache
LRU, also known as "Least Recently Used", is a cache algorithm which discards the the least recently used entry when we push a new entry to the cache.This problem wants us to implement two funct原创 2014-03-29 22:10:29 · 589 阅读 · 0 评论 -
[Leetcode]Reorder List
class Solution {public: void reorderList(ListNode *head) { if (!head) { return; } ListNode *a, *b; splitList(head, a, b); b = reverseList(b原创 2014-04-05 00:18:47 · 454 阅读 · 0 评论