Search for question
Question

1. Given a list of n students GPAS, where each GPA ranges from 0 to 4.00, a. write an algorithm that applies count sort on this list. b. What is the

time complexity of your algorithm.? 2. Given an array A[1..n] where each element is an integer in the range 0.. k-1, a. write an algorithm to get the element with the rth rank. b. What is the time complexity of your algorithm.? 3. Given an array A[1..n] of unordered numbers and a number X, a. write an algorithm to find the rank of x in A even if x does not exist in A. b. What is the time complexity of your algorithm.? Rank( 5, A) = 2; For example, let A= [5, 6, 3,7] Rank( 8, A) = 5 2

Fig: 1