码迷,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...
分类:其他好文   时间:2015-07-09 14:41:20    阅读次数:87
Search in Rotated Sorted Array II
Question:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a fu...
分类:其他好文   时间:2015-07-08 22:28:49    阅读次数:162
[LeetCode] Implement Queue using Stacks
A classic interview question. This link has a nice explanation of the idea using two stacks and its amortized time complexity.I use the same idea in m...
分类:其他好文   时间:2015-07-07 12:33:18    阅读次数:102
leetCode 23. Merge k Sorted Lists (合并k个排序链表) 解题思路和方法
Merge k Sorted Lists  Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路:此题是由合并两个排序链表演化而来,刚开始,想法比较简单,像求最大公共前缀一样,逐一求解;但是最后超时,所以马上意识到出题方是为了使用归并和分...
分类:编程语言   时间:2015-07-07 09:31:31    阅读次数:131
【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 order of O(log n). If the target is not found i...
分类:其他好文   时间:2015-07-06 14:23:26    阅读次数:110
[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 order of O(log n). If the target is not found ...
分类:其他好文   时间:2015-07-04 12:45:48    阅读次数:99
Sort List
https://leetcode.com/problems/sort-list/Sort ListSort a linked list inO(nlogn) time using constant space complexity.来自http://www.cnblogs.com/zuoyuan/p...
分类:其他好文   时间:2015-07-02 22:15:21    阅读次数:149
LeetCode:Factorial Trailing Zeroes
Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Cred...
分类:其他好文   时间:2015-07-02 13:49:59    阅读次数:101
LeetCode——Search for a Range
Description:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must b...
分类:其他好文   时间:2015-06-28 01:09:44    阅读次数:120
LeetCode之“链表”:Sort List
题目链接 题目要求: Sort a linked list inO(nlogn) time using constant space complexity. 满足O(nlogn)时间复杂度的有快排、归并排序、堆排序。在这里采用的是归并排序(空间复杂度O(logn)),具体程序如下: 1 /...
分类:其他好文   时间:2015-06-27 19:53:14    阅读次数:102
1097条   上一页 1 ... 49 50 51 52 53 ... 110 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!