码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
LeetCode: Combinations [077]
【题目】 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 = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers ...
分类:其他好文   时间:2014-06-05 11:14:26    阅读次数:255
LeetCode: Minimum Window Substring [076]
【题目】 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 = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers ...
分类:Windows程序   时间:2014-06-05 10:03:07    阅读次数:473
Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity./***Definitionforsingly-linkedlist.*structListNode{*in...
分类:其他好文   时间:2014-06-04 21:08:57    阅读次数:381
Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:其他好文   时间:2014-06-04 20:17:05    阅读次数:249
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程序   时间:2014-06-04 19:07:31    阅读次数:385
Get the largest sum of contiguous subarray in an int array
When I finished reading this problem,I thought I could solve it by scan every single subarray in the array,and the time complexity is cubic.Every su.....
分类:其他好文   时间:2014-06-04 15:30:52    阅读次数:255
LeetCode: Search in Rotated Sorted Array II [081]
【题目】 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. 【题意】 在“Search in Rotated Sorted Array”的基...
分类:其他好文   时间:2014-06-03 01:55:38    阅读次数:173
【LeetCode】Sort List
Sort ListSort a linked list inO(nlogn) time using constant space complexity.要求时间复杂度为O(nlogn),那么不能用quickSort了(最坏O(n^2)),所以使用mergeSort.通常写排序算法都是基于数组的,这题...
分类:其他好文   时间:2014-06-02 06:29:51    阅读次数:192
Single Number
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:其他好文   时间:2014-05-30 16:16:29    阅读次数:190
Sort List
Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * L...
分类:其他好文   时间:2014-05-30 15:17:18    阅读次数:312
1097条   上一页 1 ... 106 107 108 109 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!