码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
sort-list——链表、快慢指针找中间、归并排序
Sort a linked list in O(n log n) time using constant space complexity. 链表,快慢指针找中点,归并排序。 注意判断条件fast->next!=NULL&&fast->next->next!=NULL,若为fast!=NULL&&f ...
分类:编程语言   时间:2017-06-07 12:34:02    阅读次数:172
LeetCode 004 Median of Two Sorted Arrays - Java
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 ...
分类:编程语言   时间:2017-06-04 00:16:34    阅读次数:232
562. Longest Line of Consecutive One in Matrix
This is an easy question. No matter what kind of method you chose, the time complexity is at least O(m*n), becasue you have to traverse each element a ...
分类:其他好文   时间:2017-06-03 09:49:10    阅读次数:292
532. K-diff Pairs in an Array
https://leetcode.com/problems/k-diff-pairs-in-an-array/#/description This is a very simple question. With two-pointer method, the time complexity is O ...
分类:其他好文   时间:2017-05-31 10:21:51    阅读次数:131
leetCode 81.Search in Rotated Sorted Array II (旋转数组的搜索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 ...
分类:编程语言   时间:2017-05-25 11:55:11    阅读次数:153
leetcode链表--13、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 shoul ...
分类:编程语言   时间:2017-05-24 22:42:59    阅读次数:292
leecode 题解 || Merge k Sorted Lists 问题
problem: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Tags Divide and Conquer Linked List Heap 合 ...
分类:其他好文   时间:2017-05-16 15:49:50    阅读次数:236
排序算法
https://en.wikipedia.org/wiki/Sorting_algorithm Computational complexity theory Big O notation Total order Lists Inplacement Stability Comparison sort ...
分类:编程语言   时间:2017-05-14 13:42:24    阅读次数:164
【Lintcode】098.Sort List
题目: Sort a linked list in O(n log n) time using constant space complexity. Example Given 1->3->2->null, sort it to 1->2->3->null. Given 1->3->2->null, ...
分类:其他好文   时间:2017-05-13 11:10:13    阅读次数:155
第六课、算法效率的度量
一、常见的时间复杂度 常见时间复杂度的比较 二、算法分析 定义一个数组 此算法最好的情况时执行一次 而最坏的情况却要执行n次 注意:数据结构课程中,在没有特殊说明时,所分析算法的时间复杂度都是指最坏时间复杂度 三、算法的空间复杂度(space complexity) (1)、定义:S(n) = S( ...
分类:编程语言   时间:2017-05-03 22:01:10    阅读次数:214
1097条   上一页 1 ... 18 19 20 21 22 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!