擦!leetcode题目:Median of Two Sorted Arrays...
分类:
其他好文 时间:
2015-02-10 11:14:49
阅读次数:
123
Merge two sorted linked lists and return it as a new list. The new listshould be made by splicing together the nodes of the first two lists.
HideTags
Linked List
#pragma once
#include
usin...
分类:
其他好文 时间:
2015-02-10 09:19:48
阅读次数:
179
1 题目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...
分类:
其他好文 时间:
2015-02-09 22:49:25
阅读次数:
219
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 1 2).You are given a target valu...
分类:
其他好文 时间:
2015-02-09 17:42:52
阅读次数:
136
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr...
分类:
其他好文 时间:
2015-02-09 17:33:56
阅读次数:
132
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)).思路分析:这题容易想到O(m+n)的解法,就是先Merge两个数组,然后返...
分类:
其他好文 时间:
2015-02-09 16:06:53
阅读次数:
106
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2015-02-09 15:44:36
阅读次数:
139
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:
其他好文 时间:
2015-02-09 15:44:08
阅读次数:
112
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2015-02-09 15:37:57
阅读次数:
116
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:
其他好文 时间:
2015-02-09 15:37:57
阅读次数:
174