Question: Show your work. 1. Given an array A of size n, assume that it is equally likely that there are 0,1,2,3,...,n-1, or n zeros in

Show your work. 1. Given an array A of size n, assume that it is equally likely that there are 0,1,2,3,...,n-1, or n zeros in A. (a) What is the expected number of zero's in A? (b) Give an algorithms for counting the number of zeros in A. i. Evaluate the the worst-case asymptotic time complexity of your algorithm . ii. (show your work). iii. Give the expected run time of you algorithm. How does it compare with the wost- case run time complexity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
