码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
[LeetCode] 154. Find Minimum in Rotated Sorted Array II 寻找旋转有序数组的最小值 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 ...
分类:编程语言   时间:2018-03-10 12:05:28    阅读次数:229
[LeetCode] 23. Merge k Sorted Lists 合并k个有序链表
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 与21. Merge Two Sorted Lists的拓展,这道题要合并k个有序链表,还是可以两两合 ...
分类:其他好文   时间:2018-03-06 10:49:39    阅读次数:150
[LeetCode] 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 sh ...
分类:编程语言   时间:2018-03-02 10:21:08    阅读次数:186
Implement Queue using Two Stacks
time complexity: offer(), size(), isEmpty(): o(1) for poll and peek: worst case: offer n times, peek/poll only once: o(n) average case: offer n times, ...
分类:其他好文   时间:2018-02-21 00:25:17    阅读次数:158
Java实现单链表的快速排序和归并排序
本文描述了LeetCode 148题 "sort list" 的解法。 题目描述如下: Sort a linked list in O(n log n) time using constant space complexity. 题目要求我们在O(n log n)时间复杂度下完成对单链表的排序,我们 ...
分类:编程语言   时间:2018-02-18 17:03:33    阅读次数:201
Microsoft leetcode(Merge K Sorted Lists)
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. There are two ways, first use ArrayList to rewrite ...
分类:其他好文   时间:2018-02-18 10:32:17    阅读次数:132
SelectSort
1 /* 2 * 1: time complexity o(n^2) 3 * 2: good performance for items around 10-20: better than merge sort and quick sort 4 * 3: no extra space needed ... ...
分类:其他好文   时间:2018-02-14 23:19:06    阅读次数:233
29.leetcode172_factorial_trailing_zeroes
1.题目描述 Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 给一个数n,在线性时间内得出末尾0 ...
分类:其他好文   时间:2018-02-14 21:05:23    阅读次数:162
算法基本概念
一 算法复杂度 同一问题可用不同算法解决,而一个算法的质量优劣将影响到算法乃至程序的效率。算法分析的目的在于选择合适算法和改进算法。一个算法的评价主要从时间复杂度和空间复杂度来考虑。 空间复杂度: 空间复杂度(Space Complexity)是对一个算法在运行过程中临时占用存储空间大小的量度,记做 ...
分类:编程语言   时间:2018-01-31 22:19:30    阅读次数:211
Leetcode 23: Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. ...
分类:其他好文   时间:2018-01-31 11:20:29    阅读次数:134
1097条   上一页 1 ... 11 12 13 14 15 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!