Question: 1. (2 marks) Array A contains n natural integers numbers. An algorithm has been developed in a way that it executes an O(log n)-time
1. (2 marks) Array A contains n natural integers numbers. An algorithm has been developed in a way that it executes an O(log n)-time computation for each odd number in A and an O(n)-time computation for each even number in A. (a) (b) What is the best-case running time of the developed algorithm? What is the worst-case running time of the developed algorithm?
Step by Step Solution
There are 3 Steps involved in it
Step1 The bestcase running time of the algorithm would be when ... View full answer
Get step-by-step solutions from verified subject matter experts
