leetcode 刷题报告
lmengchen
这个作者很懒,什么都没留下…
展开
-
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".原创 2014-05-29 12:03:34 · 509 阅读 · 0 评论 -
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 examples: ["2", "1", "+原创 2014-05-29 12:49:36 · 378 阅读 · 0 评论 -
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 positive) of the key if原创 2014-07-03 10:52:29 · 301 阅读 · 0 评论 -
Binary Tree Preorder Traversal
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].原创 2014-07-03 10:56:26 · 246 阅读 · 0 评论 -
Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].原创 2014-07-04 01:54:20 · 250 阅读 · 0 评论 -
Insertion Sort List
Sort a linked list using insertion sort.原创 2014-05-31 12:35:45 · 363 阅读 · 0 评论 -
Sort List
Sort a linked list in O(n log n) time using constant space complexity.The tricky point of this problem is that these number stored in an li原创 2014-05-31 12:23:19 · 360 阅读 · 0 评论