QUESTION 3 Based on the following pseudocode: greatest(int A[], int n) { greatestValue =A[O]; for(i=1;i
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
QUESTION 3 Based on the following pseudocode: greatest(int A[], int n) { greatestValue =A[O]; for(i=1;i
QUESTION 3 Based on the following pseudocode: greatest(int A[], int n) { greatestValue =A[O]; for(i=1;i<n; i++){ if(A[]> greatestValue) { greatestValue =A;} } Retum greatest;} Write a function that represents the execution cost for the worst scenario. Asumme the following cost for each instruction type: Assignment C1 For loop C2 If then C3 Return clause C4