Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
beder
· 14y ago · 0 comments
You can do a second pass over the list to check that your solution is actually a majority element. This maintains the linear time and constant space properties.
Comments
[–]
justincormack
14y ago
Unfortunately single pass is usually the binding constraint eg real time data processing.