- #1
darkvalentine
- 12
- 0
Homework Statement
Compute the time complexity of the following sorting algorithm on an array L[0..n-1] in terms of n. Basic Operation only includes comparison and swap.
sort (L, n)
{
int i=0, j;
while(i<n-1){
s = i ;
j=i+1;
while(j<n){
if (L[j]<L
j++;
}
swap (L,L
i++;
}
}
Homework Equations
N/A
The Attempt at a Solution
Well, we have just studied about the big O notation last week, but I have no idea how we apply it to solve this kind of problem.