码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
172. Factorial Trailing Zeroes -- 求n的阶乘末尾有几个0
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. (1) (2) ...
分类:其他好文   时间:2016-08-23 18:50:47    阅读次数:139
Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functi ...
分类:其他好文   时间:2016-08-21 13:45:39    阅读次数:122
Minimum Window Substring, 包含子串的最小窗口,双指针
问题描述:给定字符串S,子串T,求S中包含T的最小窗口 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 ...
分类:Windows程序   时间:2016-08-20 23:11:20    阅读次数:309
148. Sort List -- 时间复杂度O(n log n)
Sort a linked list in O(n log n) time using constant space complexity. 归并排序 ...
分类:其他好文   时间:2016-08-20 21:52:55    阅读次数:186
LeetCode 23. Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.这道题如果有第21题 合并两个链表的基础就会比较容易,具体合并链表的时候有两种思路(1)如果k个list... ...
分类:其他好文   时间:2016-08-14 23:56:46    阅读次数:201
LeetCode23 Merge k Sorted Lists
题意: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. (Hard) 分析: 方法1: 利用做过的merge 2 sorted list,将头两个归并 ...
分类:其他好文   时间:2016-08-13 22:40:14    阅读次数:253
23. Merge K Sorted Lists (Java, 归并排序的思路)
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 解析:合并k个已经有序的单链表,使其最终成为一个有序的单链表。原理就是归并排序,递归运算。基本算 ...
分类:编程语言   时间:2016-08-13 22:33:31    阅读次数:285
148. Sort List (java 给单链表排序)
题目:Sort a linked list in O(n log n) time using constant space complexity. 分析:给单链表排序,要求时间复杂度是O(nlogn),空间复杂度是O(1)。时间复杂度为O(nlogn)的排序算法有快速排序和归并排序, 但是,对于单链 ...
分类:编程语言   时间:2016-08-13 21:01:28    阅读次数:163
LeetCode: 34. Search for a Range
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 or ...
分类:其他好文   时间:2016-08-11 13:02:21    阅读次数:178
leetcode-【hard】4. Median of Two Sorted Arrays
题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity ...
分类:其他好文   时间:2016-08-10 16:13:53    阅读次数:140
1097条   上一页 1 ... 26 27 28 29 30 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!