Register | Login

Design an algorithm that, given a list of n elements in an array, finds all the elements that appear more than n/3 times in the list.
The algorithm should run in linear time.
You are expected to use comparisons and achieve linear time.

Who Voted for this Story


Comments


Written by csguy (#13)
532 days ago
I think if we can use a Trie as a hashing scheme and created while reading each elements, we should be able to get the elements greater than a given count. But this will work for all kinds of frequencies.



Written by csguy (#13)
526 days ago
http://apps.topcoder.com/forums/?module=Thread&threadID=729518&start=0




Indian Social News and Links Network