上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页

2014年9月6日

Median of Two Sorted Arrays

摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be 阅读全文

posted @ 2014-09-06 16:50 bug睡的略爽 阅读(137) 评论(0) 推荐(0) 编辑

2014年9月5日

Minimum Window Substring

摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S = "ADOBECOD 阅读全文

posted @ 2014-09-05 10:18 bug睡的略爽 阅读(180) 评论(0) 推荐(0) 编辑

2014年9月4日

Partition List

摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文

posted @ 2014-09-04 10:50 bug睡的略爽 阅读(138) 评论(0) 推荐(0) 编辑

Reorder List

摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文

posted @ 2014-09-04 10:31 bug睡的略爽 阅读(137) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Write a function to find the longest common prefix string amongst an array of strings. 这题很简单,直接依次比较即可,代码如下: 1 class Solution { 2 public: 3 string long 阅读全文

posted @ 2014-09-04 10:04 bug睡的略爽 阅读(140) 评论(0) 推荐(0) 编辑

2014年9月3日

Two Sum 系列

摘要: Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of t 阅读全文

posted @ 2014-09-03 21:17 bug睡的略爽 阅读(176) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array

摘要: 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 7 might become 4 5 6 7 0 阅读全文

posted @ 2014-09-03 16:32 bug睡的略爽 阅读(121) 评论(0) 推荐(0) 编辑

Interleaving String

摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = "aabcc",s2 = "dbbca", When s3 = "aadbbcbcac", ret 阅读全文

posted @ 2014-09-03 15:47 bug睡的略爽 阅读(152) 评论(0) 推荐(0) 编辑

Longest Valid Parentheses

摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文

posted @ 2014-09-03 10:40 bug睡的略爽 阅读(223) 评论(3) 推荐(1) 编辑

2014年9月2日

Valid Parentheses

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

posted @ 2014-09-02 11:21 bug睡的略爽 阅读(140) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页

导航