Friday, January 24, 2014

SPOJ 6171. Majority

http://www.spoj.com/problems/MAJOR/

This task is another implementation task. It can be done using both arrays and maps. I prefer the first option because its easier to implement. The numbers are low so you can just read the input and somehow keep that you read that number once and then add up that number every time you come across to it again.
Make sure to check the source code for implementation details.



      DOWNLOAD THE FULL SOURCE CODE

No comments:

Post a Comment