05 2015 档案

33. Search in Rotated Sorted Array
摘要: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).You are given a target value t... 阅读全文

posted @ 2015-05-29 08:45 shini 阅读(93) 评论(0) 推荐(0)

28. Implement strStr()
摘要:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The si... 阅读全文

posted @ 2015-05-28 08:40 shini 阅读(93) 评论(0) 推荐(0)

27.Remove Element
摘要:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文

posted @ 2015-05-28 08:27 shini 阅读(92) 评论(0) 推荐(0)

26. Remove Duplicates from Sorted Array
摘要:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文

posted @ 2015-05-28 08:23 shini 阅读(83) 评论(0) 推荐(0)

22. Generate Parentheses
摘要:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文

posted @ 2015-05-28 08:12 shini 阅读(87) 评论(0) 推荐(0)

24. Swap Nodes in Pairs
摘要:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文

posted @ 2015-05-14 08:18 shini 阅读(101) 评论(0) 推荐(0)

21. Merge Two Sorted Lists
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.经典实现题。/**... 阅读全文

posted @ 2015-05-13 08:24 shini 阅读(82) 评论(0) 推荐(0)

20. Valid Parentheses
摘要:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文

posted @ 2015-05-13 08:20 shini 阅读(125) 评论(0) 推荐(0)

19. Remove Nth Node From End of List
摘要:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文

posted @ 2015-05-13 08:09 shini 阅读(111) 评论(0) 推荐(0)

17. Letter Combinations of a Phone Number
摘要:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文

posted @ 2015-05-13 05:06 shini 阅读(108) 评论(0) 推荐(0)

209. Minimum Size Subarray Sum
摘要:Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i... 阅读全文

posted @ 2015-05-12 05:38 shini 阅读(146) 评论(0) 推荐(0)

导航