835 views
1 1 vote
The frequency of a number in an array is the number of times it appears in the array. Describe an algorithm that finds the most frequent number in an array of $n$ numbers. If there are multiple numbers with highest frequency then list them all. Analyze the complexity of your algorithm.

2 Answers

Position:
Show:

Related questions

2 2 votes
2 2 answers
829
829 views
go_editor asked May 27, 2016
829 views
Let $A$ be array of $n$ integers that is not assumed to be sorted. You are given a number $x$. The aim is to find out if there are indices $k,\: l$ and $m$ such that $A[...
2 2 votes
1 1 answer
700
700 views
go_editor asked May 27, 2016
700 views
Let $A$ be an array of $n$ integers, sorted so that $A \leq A \leq \dots \leq A[n]$. You are given a number $x$x. The aim is to find out if there are indices $k$ and $l...
1 1 vote
1 1 answer
774
774 views
go_editor asked May 27, 2016
774 views
$\text{Air CMI }$operates direct flights between different cities. For any pair of cities $A$ and $B$, there is at most one flight in a day from $A$ to $B$. The online si...
1 1 vote
1 answers 1 answer
1.0k
1.0k views
go_editor asked May 27, 2016
1,013 views
Alan’s task is to design an algorithm for a decision problem $P$. He knows that there is an algorithm $A$ that transforms instances of $P$ to instances of the Halting Pro...