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. A 1-12,3,-12, 4, 1, 1,-12, 1,-1,1,2,3, 4, 2, 3,-12 Then the output of your program should be N Count 2 4. 12 4 **To get full credit, your algorithm should be indented properly. 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 (eg. if it has major logical errors), max 5 credit is available for 1.b [ 34, 5, 8, 19, 23, 1, 30, 51 using merge sort and illustrate your (20 Points) Sort array A recursion calls it is shown in your lecture notes (sorting.pdf) 2. (30 Points) Please compute the following postfix expression using stack as shown in your textbook (page 106-107). For every scan, you need to show your stack and indicate the 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
