Question: Find the time complexity (in big Oh notation) of the following algorithms: a- int Maximum(int A[], int size) //assume array A is already sorted
Find the time complexity (in big Oh notation) of the following algorithms: a- int Maximum(int A[], int size) //assume array A is already sorted in descending order { return A[0]; } b- bool PrintPositive(int A[], int size) { for(int i = 0; i < size; i++) if(A[i]>0) print(A[i]); Find the time complexity (in big Oh notation) of the following algorithms: a- int Maximum(int A[], int size) //assume array A is already sorted in descending order { return A[0]; } b- bool PrintPositive(int A[], int size) { for(int i = 0; i < size; i++) if(A[i]>0) print(A[i]);
Step by Step Solution
3.55 Rating (165 Votes )
There are 3 Steps involved in it
Lets analyze the time complexities of the given algorithms Algorithm a cpp int Maxim... View full answer
Get step-by-step solutions from verified subject matter experts
