码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
【LeetCode】Merge k Sorted Lists 解题报告
【题目】 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 合并几个有序链表为一个,分析算法复杂度。 【分治】 直观的想法是两两合并,有两种方法:1)list1和list2合并为newlist2,newlist2再和list3合...
分类:其他好文   时间:2014-12-26 11:12:18    阅读次数:129
leetcode之找光棍数
题目: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without ...
分类:其他好文   时间:2014-12-25 23:43:28    阅读次数:450
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)). Show Tags...
分类:其他好文   时间:2014-12-24 01:16:15    阅读次数:148
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 ...
分类:其他好文   时间:2014-12-23 23:49:51    阅读次数:212
[leetcode] Search for a Range
Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ...
分类:其他好文   时间:2014-12-23 13:44:37    阅读次数:108
【leetcode】Search in Rotated Sorted Array II
Search in Rotated Sorted Array IIFollow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity...
分类:其他好文   时间:2014-12-20 23:26:15    阅读次数:214
【LeetCode】Merge k Sorted Lists
Merge k Sorted ListsMergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.多路归并。1、用make_heap函数维护一个大小为k的最小堆。注:...
分类:其他好文   时间:2014-12-20 11:34:12    阅读次数:163
Single Number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ext...
分类:其他好文   时间:2014-12-19 19:14:19    阅读次数:141
leetcode -- Search for a Range
Q:Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target is not foun...
分类:其他好文   时间:2014-12-19 10:08:58    阅读次数:174
【LeetCode】Search for a Range
Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity ...
分类:其他好文   时间:2014-12-18 00:04:06    阅读次数:204
1097条   上一页 1 ... 81 82 83 84 85 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!