摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2015-08-01 22:50 ~每天进步一点点~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-08-01 22:29 ~每天进步一点点~ 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort... 阅读全文
posted @ 2015-08-01 22:17 ~每天进步一点点~ 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-08-01 21:59 ~每天进步一点点~ 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C prog... 阅读全文
posted @ 2015-08-01 21:38 ~每天进步一点点~ 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express... 阅读全文
posted @ 2015-08-01 20:51 ~每天进步一点点~ 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line./** * Definition for a point. * class Point { * i... 阅读全文
posted @ 2015-08-01 18:37 ~每天进步一点点~ 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * public class ListNode { * int val; *... 阅读全文
posted @ 2015-08-01 17:58 ~每天进步一点点~ 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort./** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * L... 阅读全文
posted @ 2015-08-01 17:16 ~每天进步一点点~ 阅读(138) 评论(0) 推荐(0) 编辑