Question: Question 1 [20 marks] a. [10 marks] Prove that log2 (n!) O(n log2 n), where n is a positive integer. b. [10 marks] The distance
![Question 1 [20 marks] a. [10 marks] Prove that log2 (n!)](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f45e4dae862_95766f45e4d50ce2.jpg)
Question 1 [20 marks] a. [10 marks] Prove that log2 (n!) O(n log2 n), where n is a positive integer. b. [10 marks] The distance between two numbers x and y is computed as lx - y. The brute-force algorithm for finding the distance between the two closest elements in an array of n numbers is given below. Algorithm MinDistance(A[0..n - 1]) Input: An array A[0..n-1) of numbers Output: The minimum distance d between two of its elements dmin 0 for it it 0 ton-2 do for+i+ 1 to n - 1 do temp + A[i] - A[] if temp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
