摘要:
Problem Description:Sort a linked list inO(nlogn) time using constant space complexity.Solution: 1 public ListNode sortList(ListNode head) { 2 ... 阅读全文
posted @ 2014-06-29 13:49
HaruHaru
阅读(171)
评论(0)
推荐(0)
摘要:
Problem Description:Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Solution: 1 public int maxPoint... 阅读全文
posted @ 2014-06-29 13:47
HaruHaru
阅读(127)
评论(0)
推荐(0)
摘要:
Problem Description:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integ... 阅读全文
posted @ 2014-06-29 13:40
HaruHaru
阅读(173)
评论(0)
推荐(0)
摘要:
Problem Description:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Solution: ... 阅读全文
posted @ 2014-06-29 13:36
HaruHaru
阅读(110)
评论(0)
推荐(0)
摘要:
Problem Description:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Solution: 递归。 1 public List>... 阅读全文
posted @ 2014-06-29 13:31
HaruHaru
阅读(112)
评论(0)
推荐(0)