Median of Two Sorted Arrays
There 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 (...
分类:
其他好文 时间:
2014-08-27 14:47:18
阅读次数:
148
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 in t...
分类:
其他好文 时间:
2014-08-27 13:05:17
阅读次数:
226
合并是一维数据结构中很常见的操作, 通常是排序, 分布式算法中的子操作。 这篇总结主要介绍LeetCode中关于合并的几个题目: Merge Two Sorted ListsMerge Sorted ArraySort ListMerge k Sorted Lists我们先来看看两个有序一维数据的合并, 这里主要是要介绍链表的合并操作, 不过因为一维数组的合并也比较简单, 而且与链表有比较性, 就...
分类:
其他好文 时间:
2014-08-27 12:59:07
阅读次数:
348
字典的排序:按键排序sorted(dic.iteritems(),key=lambdadic:dic[0],reverse=False)按值排序sorted(dic.iteritems(),key=lambdadic:dic[1],reverse=False)如果在继承关系中,父类中的字段是__fi...
分类:
编程语言 时间:
2014-08-27 08:10:37
阅读次数:
276
Sorting It All Out
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 27929
Accepted: 9655
Description
An ascending sorted sequence of distinct values is on...
分类:
其他好文 时间:
2014-08-26 19:40:46
阅读次数:
194
Follow up for "Search in Rotated Sorted Array":
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...
分类:
其他好文 时间:
2014-08-26 17:19:16
阅读次数:
191
An index is used to speed up searching in the database.By default, when you create this table, your data will be stored on disk and sorted by the "Id"...
分类:
数据库 时间:
2014-08-25 22:30:34
阅读次数:
407
Search in Rotated Sorted Array
Total Accepted: 22300 Total
Submissions: 77945My Submissions
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 ...
分类:
其他好文 时间:
2014-08-25 21:15:35
阅读次数:
227
Redis 服务器Remote Dictionay Server Redis是一个key-value持久化产品,通常被称为数据结构服务器。Redis的key是string类型;value可以是string、hash、list、set、sorted set等类型;实际上,Redis内部会将key和va...
分类:
其他好文 时间:
2014-08-25 20:46:54
阅读次数:
673
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路: 1 cla...
分类:
其他好文 时间:
2014-08-25 18:38:04
阅读次数:
211