Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially...
分类:
其他好文 时间:
2015-01-31 00:03:18
阅读次数:
165
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
#include
#include
typedef struct TreeNode {
int v...
分类:
其他好文 时间:
2015-01-30 22:50:28
阅读次数:
266
题目链接:3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input...
分类:
其他好文 时间:
2015-01-30 22:42:30
阅读次数:
252
Problem 1 : Is it a loop ? (判断链表是否有环?)Assume that wehave a head pointer to a link-list. Also assumethat we know the list is single-linked. Can you com...
分类:
编程语言 时间:
2015-01-30 20:53:04
阅读次数:
307
【题目】
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majorit...
分类:
其他好文 时间:
2015-01-30 17:48:21
阅读次数:
153
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and co...
分类:
其他好文 时间:
2015-01-29 19:36:35
阅读次数:
168
题目:
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
Find the minimum element.
You may assume no duplicate e...
分类:
其他好文 时间:
2015-01-29 17:41:59
阅读次数:
167
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majority element ...
分类:
其他好文 时间:
2015-01-29 16:05:16
阅读次数:
164
转自《汇编语言》论坛这儿争论有什么意思,做个实验测试一下就可以了,最大是64K应该没有人反对吧 那就是最小了,有的说0 byte, 有的说16Bytes, 有的说其他的,那到底是多少,我们看这个程序assume cs:code, ds:datadata segment data endscode s...
分类:
编程语言 时间:
2015-01-29 11:53:48
阅读次数:
229
Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially...
分类:
其他好文 时间:
2015-01-28 11:05:10
阅读次数:
194