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
Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the cod...
分类:
其他好文 时间:
2014-08-27 14:45:48
阅读次数:
236
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
题目:
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) ...
分类:
其他好文 时间:
2014-08-27 09:29:57
阅读次数:
174
There are two parts to your question:fixingtemporary resolvemessagesfixing the package management issuesTemporary resolveIt is likely that this issue ...
分类:
其他好文 时间:
2014-08-27 09:20:07
阅读次数:
248
字典的排序:按键排序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
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all d...
分类:
其他好文 时间:
2014-08-27 00:11:56
阅读次数:
308