02 2014 档案

Palindrome Number [LeetCode]
摘要:Determine whether an integer is a palindrome. Do this without extra space.Summary:Get the digital number first, then caculate digitial from both way and compare them. int pow_10(int n){ int result = 1; while(n > 0 ){ result *= 10; n --; } return r... 阅读全文

posted @ 2014-02-03 12:41 假日笛声 阅读(213) 评论(0) 推荐(0)

Sort List [LeetCode]
摘要:Sort a linked list inO(nlogn) time using constant space complexity.Summary: Basicly I apply quick sort to linked lists.Everytime, I get the head of the list and split the whole linked list to two lists with its value, all the left nodes have value which are less than value of head, and all the right 阅读全文

posted @ 2014-02-03 12:13 假日笛声 阅读(366) 评论(0) 推荐(0)