码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
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-05-14 23:03:01    阅读次数:171
LeetCode-Single Number II----位运算
Single Number II Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implem...
分类:其他好文   时间:2016-05-12 18:41:48    阅读次数:149
4. Median of Two Sorted Arrays
1、Median of Two Sorted Arrays——这是leedcode的第四题: 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 shou...
分类:其他好文   时间:2016-05-12 16:29:12    阅读次数:223
KMP算法
前言:解 题目 Leetcode 28 Implement strStr()时,查阅和整理了关于KMP算法的资料。 The complexity of the getnext() algorithm is O(k), where k is the length of patterns(模式串/needles)。 next数组的构建的时间复杂度是O(k) The search port...
分类:编程语言   时间:2016-05-12 11:40:05    阅读次数:248
148. Sort List
Sort a linked list in O(n log n) time using constant space complexity. 代码如下: ...
分类:其他好文   时间:2016-05-09 15:50:17    阅读次数:178
CLRS:sorting in linear time O(n)
//intput array A,output array result. count array count . //all the elements is in te range of 0~k. //if k=O(n),the complexity is Θ(n) //counting sort ...
分类:其他好文   时间:2016-05-07 22:04:27    阅读次数:170
23. Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 合并k个有序链表。 此题的思路类似归并排序,而归并排序有两种思路,一种是从上往下递归,一种是从下往上迭 ...
分类:其他好文   时间:2016-05-07 13:03:43    阅读次数:130
Leetcode - 4. Median of Two Sorted Arrays
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 should be O(log...
分类:其他好文   时间:2016-05-07 10:00:11    阅读次数:141
81. 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 function to determine if a given target is in the array.这个...
分类:其他好文   时间:2016-05-07 09:36:39    阅读次数:130
Java TreeSet with Comparator sorting
TreeSet guarantees no duplicate data, also guarantees long(n) time complexity for add(), remove(), contains(). entry name = GREENentry i = 2green 2 ad ...
分类:编程语言   时间:2016-05-06 02:15:17    阅读次数:202
1097条   上一页 1 ... 30 31 32 33 34 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!