In: Computer Science
Give the asymptotic (“big-Oh”) running time complexity of the
following
algorithm, show all the work you have done.
Algorithm: ArrayMangle(A[ ], int n)
Input: an array A, an integer n
x = 0;
for (i=0; i<=n-1; i++) {
for (j=i; j<=n-1; j++) {
x = x + A[j];
}
for (k=0; k<= n-1; k++) {
for (j=0; j< =n-1; j++) {
x = x + A[j]*A[k];
}
}
}