码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
第四题:Median of Two Sorted Arrays
擦!leetcode题目:Median of Two Sorted Arrays...
分类:其他好文   时间:2015-02-10 11:14:49    阅读次数:123
21.Merge Two Sorted Lists(法1头部附加节点法2二级指针)
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
[leet code 4] Median of Two Sorted Arrays
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
(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 7 might become 4 5 6 7 0 1 2).You are given a target valu...
分类:其他好文   时间:2015-02-09 17:42:52    阅读次数:136
(74)Search a 2D Matrix
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
LeetCode 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 O(log (m+n)).思路分析:这题容易想到O(m+n)的解法,就是先Merge两个数组,然后返...
分类:其他好文   时间:2015-02-09 16:06:53    阅读次数:106
leetcode[83]Remove Duplicates from Sorted List
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
leetcode[82]Remove Duplicates from Sorted List II
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
leetcode[74]Search a 2D Matrix
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
leetcode[81]Search in Rotated Sorted Array II
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!