Question: 2 / 2 100% + CS1503 - Algorithms and Data Structures - Spring 2021 Homework 2 - Page 2 of 2 3. In the following
2 / 2 100% + CS1503 - Algorithms and Data Structures - Spring 2021 Homework 2 - Page 2 of 2 3. In the following randomized function, A is the input array with size n. RANDOM(1) produces a uniformly random number between 1 and n. [20pt.) (a) Determine its asymptotic time complexity in the worst case. (b) Using probabilistic analysis, determine its asymptotic time complexity on average. 1: function RAND-ALG(A. n) -A[1] k=RANDOM() if k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
