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 should be O(log (m+n)).
这是一道非常经典的题。这题更通用的形式是,给定...
分类:
其他好文 时间:
2015-05-04 12:00:57
阅读次数:
100
Factorial Trailing Zeroes:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Sol...
分类:
其他好文 时间:
2015-05-03 20:28:07
阅读次数:
122
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解题思路一:之前我们有mergeTwoLists(ListNode l1, ListNode l2)方法...
分类:
编程语言 时间:
2015-05-03 17:25:06
阅读次数:
272
What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in the array....
分类:
其他好文 时间:
2015-05-02 12:28:06
阅读次数:
128
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-01 17:19:25
阅读次数:
151
喵~不知不觉到了CUDA系列学习第五讲,前几讲中我们主要介绍了基础GPU中的软硬件结构,内存管理,task类型等;这一讲中我们将介绍3个基础的GPU算法:reduce,scan,histogram,它们在并行算法中非常常用,我们在本文中分别就其功能用处,串行与并行实现进行阐述。1. Task complexitytask complexity包括step complexity(可以并行成几个操作)...
分类:
编程语言 时间:
2015-05-01 16:11:12
阅读次数:
263
It can be inserted anywhere. Note that if you insert it in the beginning the TC will be O(#s +c), but it is also O(#s+ n). Remember that the TC is an ...
分类:
其他好文 时间:
2015-05-01 07:08:22
阅读次数:
225
题目: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 s...
分类:
其他好文 时间:
2015-04-30 23:08:07
阅读次数:
128
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-04-30 16:19:15
阅读次数:
133
problem:
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 impl...
分类:
其他好文 时间:
2015-04-30 10:49:00
阅读次数:
126