码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
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 should be O(log (m+n)).   最后从medianof two sorted arrays中看到...
分类:其他好文   时间:2015-01-21 16:31:27    阅读次数:123
[Leetcode][JAVA] 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...
分类:编程语言   时间:2015-01-21 06:35:47    阅读次数:255
[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 = "ADOBECODEBANC" T = "ABC" Minimum window is "BAN...
分类:Windows程序   时间:2015-01-20 12:03:35    阅读次数:219
Leetcode Merge k Sorted Lists
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.对于这道题,之前并不知道java中有一个封装好的数据结构--优先队列。优先队列其实相当于一个最大或最小堆,能...
分类:其他好文   时间:2015-01-18 18:24:56    阅读次数:210
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-01-18 17:04:57    阅读次数:198
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 with...
分类:其他好文   时间:2015-01-18 13:14:19    阅读次数:196
[LeetCode#154]Find Minimum in Rotated Sorted Array II
The question:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?S...
分类:其他好文   时间:2015-01-18 07:06:07    阅读次数:338
leetcode 136. Single Number && 137. Single Number II
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:其他好文   时间:2015-01-17 17:43:10    阅读次数:110
Factorial Trailing Zeroes
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.最初想法是计算里面能被5整除的数字的个数(因为能被2整除的...
分类:其他好文   时间:2015-01-16 16:25:27    阅读次数:130
LeetCode--Find Minimum in Rotated Sorted Array 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 sorted array is rotated at some pivot u...
分类:其他好文   时间:2015-01-15 22:14:10    阅读次数:166
1097条   上一页 1 ... 74 75 76 77 78 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!