码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
Java [leetcode 23]Merge k Sorted Lists
题目描述:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解题思路:分而自治方法。将K个List不断地分解为前半部分和后半部分。分别进行两个List的合...
分类:编程语言   时间:2015-05-14 20:09:23    阅读次数:127
single-number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra...
分类:其他好文   时间:2015-05-13 22:01:30    阅读次数:138
【leetcode】Factorial Trailing Zeros
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity. 1 class Solution { 2 publ...
分类:其他好文   时间:2015-05-13 08:45:27    阅读次数:134
LeetCode 136、137:Single Number I & II
Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you imple...
分类:其他好文   时间:2015-05-12 23:10:19    阅读次数:160
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 w...
分类:其他好文   时间:2015-05-11 22:12:08    阅读次数:145
LeetCode 23 Merge k Sorted Lists (C,C++,Java,Python)
Problem: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Solution: 采用胜者树的方法,胜者树介绍:胜者树,假如链表数组长度为n,链表元素总个数为k,那么时间复杂度为O(k*log(n)) 题目大意: ...
分类:编程语言   时间:2015-05-11 16:07:50    阅读次数:128
Java 计算N阶乘末尾0的个数-LeetCode 172 Factorial Trailing Zeroes
题目Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.分析Note中提示让用对数的时间复杂度求解,那么如果粗...
分类:编程语言   时间:2015-05-11 12:48:10    阅读次数:205
Minimum Window Substring
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)...
分类:Windows程序   时间:2015-05-10 23:43:00    阅读次数:172
Median of Two Sorted Arrays
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should...
分类:其他好文   时间:2015-05-10 20:08:21    阅读次数:125
leetcode | Median of Two Sorted Arrays 寻找2个有序数组中第k大的值
问题 Median of Two Sorted ArraysThere 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)). 分析本题更经...
分类:编程语言   时间:2015-05-10 19:03:48    阅读次数:119
1097条   上一页 1 ... 56 57 58 59 60 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!