上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 84 下一页
摘要: 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-02-08 15:29 穆穆兔兔 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 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-02-08 15:05 穆穆兔兔 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o... 阅读全文
posted @ 2015-02-08 14:41 穆穆兔兔 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 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-02-08 10:31 穆穆兔兔 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.方法一:实现merger2Lists,然后两个两个List Merge,直到最后,不过超时了class So... 阅读全文
posted @ 2015-02-07 14:38 穆穆兔兔 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-02-07 13:39 穆穆兔兔 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 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-02-06 14:14 穆穆兔兔 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings.思路: 很简单,其他字符串和第一个字符串比较,一个一个字符比较,反正最长不会超过第一个字符串的长度。class Solution... 阅读全文
posted @ 2015-02-06 11:12 穆穆兔兔 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 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-02-06 10:38 穆穆兔兔 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路:从各位向前处理,当前字符代表的数比后面一位字符代表的数大(包括等于),就加,小就减... 阅读全文
posted @ 2015-02-05 17:24 穆穆兔兔 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 84 下一页