求教bcl-xl蛋白命名格式# Biology - 生物学
m*r
1 楼
Design a method findEvenFreq(int[] a), which returns the single integer
value in the array which occurs with even frequency. Other numbers occur odd
numbers , which may be 7, 11 or even larger. All integers will be positive.
What if the integers are continuous.
For example, [1, 2, 3, 1] should return 1.
What if the integers may not be continuous.
example, [4, 8, 7, 5, 8 ] should return 8
The largest number can be INT_MAX.
I know how to solve it by hahstable.
Better ideas about O(1) space with O(n) time ?
thanks
value in the array which occurs with even frequency. Other numbers occur odd
numbers , which may be 7, 11 or even larger. All integers will be positive.
What if the integers are continuous.
For example, [1, 2, 3, 1] should return 1.
What if the integers may not be continuous.
example, [4, 8, 7, 5, 8 ] should return 8
The largest number can be INT_MAX.
I know how to solve it by hahstable.
Better ideas about O(1) space with O(n) time ?
thanks