上一页 1 2 3 4 5 6 ··· 20 下一页

CodingTMD’s Reading List

摘要: Following reading list is selected from the papers I had read in the past 3 years. It will help you to gain a basic knowledge of what happened in curr... 阅读全文
posted @ 2014-10-24 07:30 小刀初试 阅读(220) 评论(0) 推荐(0)

[LeetCode] Evaluate Reverse Polish Notation, Solution

摘要: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e... 阅读全文
posted @ 2013-12-07 14:20 小刀初试 阅读(174) 评论(0) 推荐(0)

[LeetCode] Clone Graph, Solution

摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled... 阅读全文
posted @ 2013-12-05 15:01 小刀初试 阅读(127) 评论(0) 推荐(0)

[LeetCode] Sort List, Solution

摘要: Sort a linked list in O(n log n) time using constant space complexity.[Thoughts]O(nlgn)的排序算法没几个,无非就是quick sort, heap sort和merge sort. 对于链表排序来说,难点之一就是如... 阅读全文
posted @ 2013-12-04 14:53 小刀初试 阅读(246) 评论(0) 推荐(0)

[LeetCode] Max Points on a Line, Solution

摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.[Thoughts]任意一条直线都可以表述为y = ax + b假设,有两个点(x1,y1), (x2... 阅读全文
posted @ 2013-12-03 13:12 小刀初试 阅读(114) 评论(0) 推荐(0)

[LeetCode] LRU Cache, Solution

摘要: 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... 阅读全文
posted @ 2013-11-28 14:56 小刀初试 阅读(160) 评论(0) 推荐(0)

[LeetCode] Binary Tree Preorder Traversal, Solution

摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3... 阅读全文
posted @ 2013-11-26 13:42 小刀初试 阅读(145) 评论(0) 推荐(0)

[LeetCode] Reorder List, Solution

摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For... 阅读全文
posted @ 2013-11-24 14:31 小刀初试 阅读(160) 评论(0) 推荐(0)

[LeetCode] Linked List Cycle II, Solution

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up:Can you solve it without using extra space? ... 阅读全文
posted @ 2013-11-24 06:11 小刀初试 阅读(162) 评论(0) 推荐(0)

[LeetCode] Linked List Cycle, Solution

摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? [Thoughts] 设定两个指针,一个每次走一步,一个每次走两步,如果链表... 阅读全文
posted @ 2013-11-21 12:51 小刀初试 阅读(108) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 20 下一页