You are on page 1of 1

ᜑᜒᜏᜎᜌ᜔ ᜈ ᜐᜒᜉᜈ᜔ ᜌᜈ᜔

Discrete Mathematics

Determine the Complexity of Algorithms.

1. Express the time complexity using summing notation – count all


operations.
Simplify the summation and express using big-oh notation and big
omega notation.

void insertion_sort(int ar[99], int n){


int i,j,temp;
for (i=1;i<=n;i++){
temp = ar[i];

for (j=i-1;j>=0 && ar[j] > temp;j=j-1){


ar[j+1]= ar[j];
}
ar[j+1]=temp;
}
}

ᜀᜄ᜔ᜐᜃ
ᜒ ᜉ᜔ ᜉᜒᜇᜈᜒ -᜔
Engineer Perin

You might also like