码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
【LeetCode】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 implement it without using extra memory?...
分类:其他好文   时间:2015-03-12 22:35:49    阅读次数:164
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 ord...
分类:其他好文   时间:2015-03-12 20:48:41    阅读次数:114
Sort List
Sort List问题:Sort a linked list inO(nlogn) time using constant space complexity.思路: 归并排序我的代码:public class Solution { public ListNode sortList(ListN...
分类:其他好文   时间:2015-03-11 21:30:59    阅读次数:165
leetcode: 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...
分类:其他好文   时间:2015-03-11 21:30:30    阅读次数:123
LeetCode-154 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...
分类:其他好文   时间:2015-03-11 19:18:11    阅读次数:108
[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="ADOBECODEBA...
分类:Windows程序   时间:2015-03-11 16:52:07    阅读次数:160
【leetcode】Minimum Window Substring (hard) ★
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="ADOBECODEBA...
分类:Windows程序   时间:2015-03-11 00:27:34    阅读次数:170
Evolution(矩阵快速幂)
EvolutionTime Limit:5 Seconds Memory Limit:32768 KBDescriptionEvolution is a long, long process with extreme complexity and involves many species. Dr....
分类:其他好文   时间:2015-03-10 21:06:23    阅读次数:218
LeetCode-Sort List
Sort a linked list in O(n log n) time using constant space complexity.这题的时间复杂度要求是O(n logn),很容易想到用mergeSort来解。/** * Definition for singly-linked list. ...
分类:其他好文   时间:2015-03-09 23:54:04    阅读次数:212
LeetCode | # 23
题目: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路: 解法一:维护一个大小为k的堆,每次去堆顶的最小元素放到结果中,然后读取该元素的下一个元素放入堆中,重新维护好。因为每个链表是有序的,每次又是去当前k个元素中最小的,...
分类:其他好文   时间:2015-03-09 22:32:10    阅读次数:203
1097条   上一页 1 ... 66 67 68 69 70 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!