码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
Leetcode: Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.分析:一个很简单的解法是调用k-1次merge two sorted linkedlist,假设每个list...
分类:其他好文   时间:2014-11-25 00:03:02    阅读次数:207
Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:开始做过两两合并的链表,此时做k路合并,即将k个链表进行合并,可以先将这k个链表进行两两合并,知道合并...
分类:其他好文   时间:2014-11-24 18:43:48    阅读次数:137
【Leetcode】Sort List in java,你绝对想不到我是怎么做的^^我写完过了我自己都觉得好jian~
Sort a linked list in O(n log n) time using constant space complexity. 大家看完题目估计跟我一样啦。。。都在想哪些是nlogn啊~快速排序、归并排序、堆排序!然后开始愁,这些东西变成list了可怎么办啊。。。 可是我深深地记得在CMU的时候老师告诉我,java现在自带的Arrays.sort用的是快排,然后我就想,那么…...
分类:编程语言   时间:2014-11-24 10:10:04    阅读次数:170
Leetcode-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...
分类:Windows程序   时间:2014-11-24 08:41:35    阅读次数:322
最小覆盖子串
# 题目 > 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 = "ADOBECODEBANC" T = "ABC" Minimum window is "B...
分类:其他好文   时间:2014-11-23 23:36:47    阅读次数:411
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...
分类:其他好文   时间:2014-11-22 22:52:33    阅读次数:262
Find Minimum in Rotated Sorted Array II
Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort...
分类:其他好文   时间:2014-11-22 20:07:33    阅读次数:154
Leetcode: Find Minimum in Rotated Sorted Array II
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?前面那道题:Find ...
分类:其他好文   时间:2014-11-22 11:59:28    阅读次数:162
Leetcode-Find Minimum in Rotated Sorted Array II
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose a s...
分类:其他好文   时间:2014-11-22 07:03:46    阅读次数:206
Leetcode-Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Have you met this question in a real interview?Analy...
分类:其他好文   时间:2014-11-22 07:03:11    阅读次数:192
1097条   上一页 1 ... 86 87 88 89 90 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!