自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 [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

原创 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

原创 [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

原创 [Leetcode]Binary Tree Iterative Traversal

Three problems of binary tree traversal of Leetcode:

2014-04-04 22:51:45 610

原创 [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

原创 [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

原创 [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

原创 [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

原创 [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

原创 [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

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除