Question: a. (15 Points) Write an algorithm that calculates the frequency of each number in a given number array. In other words, you will count how

a. (15 Points) Write an algorithm that calculates the frequency of each number in a given number array. In other words, you will count how many times each number appears in the array. For example, if the array is 1. Then the output of your program should be N Count 4 2 2 1 4-1 -12 4 2 lcredit, your algorithm should be indented properly. ea b. (15 Points) What is the complexity of your solution? Perform a complexity analysis for the best case, worst case, and average case as shown in the video tutorials. *"If your algorithm is not correct (e.g. if it has major logical errors), iax 5 credit is a. (15 Points) Write an algorithm that calculates the frequency of each number in a given number array. In other words, you will count how many times each number appears in the array. For example, if the array is 1. Then the output of your program should be N Count 4 2 2 1 4-1 -12 4 2 lcredit, your algorithm should be indented properly. ea b. (15 Points) What is the complexity of your solution? Perform a complexity analysis for the best case, worst case, and average case as shown in the video tutorials. *"If your algorithm is not correct (e.g. if it has major logical errors), iax 5 credit is
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
