Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant...
分类:
其他好文 时间:
2015-03-04 21:08:58
阅读次数:
131
Given n distinct positive integers, integer k (k <= n) and a number target.Find k numbers where sum is target. Calculate how many solutions there are?...
分类:
其他好文 时间:
2015-03-04 12:59:04
阅读次数:
188
The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. ...
分类:
其他好文 时间:
2015-03-04 12:40:15
阅读次数:
202
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
分类:
其他好文 时间:
2015-03-02 19:10:38
阅读次数:
135
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...
分类:
其他好文 时间:
2015-03-02 13:16:06
阅读次数:
112
Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1) Every even digit appears an odd number of times in its decimal representat...
分类:
其他好文 时间:
2015-02-28 21:40:21
阅读次数:
112
Problem Description The digital root of a positive integer is found by
summing the digits of the integer. If the resulting value is a single
digit then that digit is the digital root. If the resu...
分类:
其他好文 时间:
2015-02-28 01:35:08
阅读次数:
142
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...
分类:
其他好文 时间:
2015-02-27 21:34:28
阅读次数:
222
Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p1^k1* p2^k2*…*pm^km.Input Specifica...
分类:
其他好文 时间:
2015-02-27 16:57:44
阅读次数:
165
Statistical approaches to randomised controlled trial analysisThe statistical approach used in the design and analysis of the vast majority of clinica...
分类:
其他好文 时间:
2015-02-27 09:56:17
阅读次数:
176