Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (anonymous):

Write a program to read a sequence of N integers and print the number that appears the maximum number of times in the sequence. INPUT Input contains two lines. First line in the input indicates N, the number of integers in the sequence. Second line contains N integers, separated by white space. OUTPUT Element with the maximum frequency. If two numbers have the same highest frequency, print the number that appears first in the sequence. CONSTRAINTS 1 <= N <= 10000 The integers will be in the range [-100,100].

OpenStudy (rbx):

What work have you done?

OpenStudy (rbx):

I know this is an assignment question from NPTEL's Programming, Data Structures and Algorithms Course and there there are about 7 hours left for submission. If you have watched the lectures, you should be able to prepare at least a partially working version, so don't expect a solution unless you have something to show.

OpenStudy (anonymous):

Mr.RBX, thanks for your reply..... i know the answer for the above program and im just posting this qn to get different answers from the users

OpenStudy (rbx):

You can find my solution here. http://openstudy.com/study#/updates/5327f0f1e4b06a39f862b7e9 Uses too much space, not what I'd like it to do.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!