码迷,mamicode.com
首页 >  
搜索关键字:complexity    ( 1097个结果
LeetCode --- 34. Search for a Range
题目链接: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 order of O(log n). If the...
分类:其他好文   时间:2015-02-04 23:24:39    阅读次数:254
LeetCode[Hash Table]: 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 "BANC"...
分类:Windows程序   时间:2015-02-04 21:50:22    阅读次数:221
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-02-04 18:44:33    阅读次数:199
LeetCode[Linked List]: Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 一开始我没有采用分治法,解题思路是:首先比较每条链表的第一个元素,找出最小的那个,插入新链表并从原链表删除,如此反复直至所有的链表都为空链表。基于这个愚蠢的解题思路,我的C++代码实现如下: ...
分类:其他好文   时间:2015-02-03 17:19:27    阅读次数:158
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. Credits: Special thanks to?@ts ?for adding this problem and creat...
分类:其他好文   时间:2015-02-03 11:23:32    阅读次数:125
Counting Sort
1. Counting Sort doesn't work for negative number.2. Counting Sort assumes that each element is SMALL INTEGER.3. Time Complexity is O(Maximum value - ...
分类:其他好文   时间:2015-02-03 01:53:09    阅读次数:130
137.Single Number II(法1排序法2STL容器map哈希法3位运算法4改进的位运算)
Given an array of integers, every element appears three timesexcept for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement itwithout using e...
分类:编程语言   时间:2015-02-02 23:15:12    阅读次数:248
Leetcode 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-02-02 22:58:13    阅读次数:280
leetcode 【 Find Minimum in Rotated Sorted Array II 】python 实现
题目:Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a s...
分类:编程语言   时间:2015-01-31 16:09:35    阅读次数:170
LeetCode --- 23. Merge k Sorted Lists
题目链接:Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 这道题的要求是将k个有序链表合并成1个有序链表,并分析其复杂度。 1. 暴力合并 最简单思路就是暴力合并,可以将k个链表一个接着一个地合并...
分类:其他好文   时间:2015-01-31 14:42:33    阅读次数:163
1097条   上一页 1 ... 71 72 73 74 75 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!