码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
Leetcode: Find Right Interval
Solution 1: TreeMap, Time complexity: O(NlogN) 像这种在一个集合里面寻找有没有比某个数小的数,一般要么treeMap要么treeSet。Interval的题经常需要用treeMap, Data Stream as Disjoint Intervals 就 ...
分类:其他好文   时间:2016-12-07 07:45:00    阅读次数:208
binary-search
For a given sorted array (ascending order) and a target number, find the first index of this number in O(log n) time complexity. If the target number ...
分类:其他好文   时间:2016-12-04 00:46:50    阅读次数:200
Leetcode: Find All Anagrams in a String
Time Complexity will be O(n) because the "start" and "end" points will only move from left to right once. Sliding Window: Use a count to denote the di ...
分类:其他好文   时间:2016-12-03 15:20:38    阅读次数:171
[LintCode] Sort List 链表排序
Sort a linked list in O(n log n) time using constant space complexity. Have you met this question in a real interview? Yes Sort a linked list in O(n l ...
分类:编程语言   时间:2016-12-03 02:10:57    阅读次数:466
Leetcode: Elimination Game
refer to https://discuss.leetcode.com/topic/59293/java-easiest-solution-o-logn-with-explanation Time Complexity: O(log n) update and record head in ea ...
分类:其他好文   时间:2016-11-30 07:51:26    阅读次数:197
Leetcode: Longest Absolute File Path
Time Complexity: O(N) The depth of the directory/file is calculated by counting how many "\t"s are there.The time complexity is O(n) because each subs ...
分类:其他好文   时间:2016-11-30 07:47:50    阅读次数:187
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 sho... ...
分类:其他好文   时间:2016-11-26 14:54:10    阅读次数:223
172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. Credits:Special thanks t ...
分类:其他好文   时间:2016-11-25 09:19:57    阅读次数:138
Leetcode: Russian Doll Envelopes
DP 解法, Time Complexity: O(N^2) sort based on width or height, anyone is ok. After the sorting, for each envelope, those envelopes which can fit into t ...
分类:其他好文   时间:2016-11-25 07:33:38    阅读次数:179
每天一道LeetCode--172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 此题是求阶乘后面零的个数。 ...
分类:其他好文   时间:2016-11-20 10:54:28    阅读次数:120
1097条   上一页 1 ... 22 23 24 25 26 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!