444 views
1 votes
1 votes
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

Related questions

2 votes
2 votes
2 answers
1
go_editor asked May 27, 2016
428 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 votes
2 votes
1 answer
2
go_editor asked May 27, 2016
417 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...