Your task is to write an assembly-language program that finds the most frequently occurring valuein a data array that starts at memory address $0 and contains $1 words. The most frequent value must be stored in register $2. If multiple distinct values have the maximum number of occurrences in the data array, returning any one of these values $2 will do. Hints: Recall that the study material for Round 5 contains example armlet programs that sort an array. You may want to sort the array first and then find the most frequent value in the sorted data. Indeed, once the data is sorted, it is easy to find out how many times each value occurs by making one scan through the data. You probably want to keep track of a value that occurs the maximum
Your task is to write an assembly-language program that finds the most frequently occurring valuein a data array that starts at memory address $0 and contains $1 words. The most frequent value must be stored in register $2. If multiple distinct values have the maximum number of occurrences in the data array, returning any one of these values $2 will do.
Hints: Recall that the study material for Round 5 contains example armlet programs that sort an array. You may want to sort the array first and then find the most frequent value in the sorted data. Indeed, once the data is sorted, it is easy to find out how many times each value occurs by making one scan through the data. You probably want to keep track of a value that occurs the maximum number of times in the array scanned so far, and update this value whenever a more frequent value occurs.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)