【发布时间】:2017-10-03 21:24:07
【问题描述】:
给定一个包含 n 个整数的数组,其中一个元素出现超过 n/2 次。我们需要在线性时间和恒定的额外空间中找到该元素。
YAAQ:又一个数组问题。
【问题讨论】:
-
这是重复的,但我不记得是哪个问题或答案是什么...
-
找到了重复的:stackoverflow.com/questions/278488/…(我有一个不同的答案。在找到重复之前写了这个答案...)
-
Yet another arrays question...未标记arrays。 (为什么?)
标签: algorithm