上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: 题目: 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 O(log (m+n)). 解题思路: 这道题,很容易想到的是先排序再直接定位中间那个... 阅读全文
posted @ 2014-04-29 10:26 mickole 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题目: 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 the two numbers such that they add up to the target, ... 阅读全文
posted @ 2014-04-28 10:53 mickole 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate word m... 阅读全文
posted @ 2014-04-28 09:41 mickole 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 题目: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each intermed... 阅读全文
posted @ 2014-04-27 17:15 mickole 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 题目: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [... 阅读全文
posted @ 2014-04-25 18:50 mickole 阅读(283) 评论(0) 推荐(1) 编辑
摘要: 题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find the total... 阅读全文
posted @ 2014-04-24 23:16 mickole 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For example, X X X XX O O XX X O ... 阅读全文
posted @ 2014-04-24 22:28 mickole 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Ret... 阅读全文
posted @ 2014-04-24 20:48 mickole 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ["aa... 阅读全文
posted @ 2014-04-23 16:54 mickole 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 注:以上图片来自网络,非常感谢拍照者提供附最后一提实现代码:#include#include#includeusing namespace std;int MaxArea(int *arr, int len){ if(arr == NULL || len > my_stack;//存放每个元... 阅读全文
posted @ 2014-04-09 16:04 mickole 阅读(629) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页