Medium
What is the complexity of this algorithm?
sort_insertion(listNumbers)
{
For i from 1 to size_of_listNumbers - 1
{
x <-- listNumbers[i];
j <-- i;
While j > 0 and listNumbers[j - 1] > x
{
listNumbers[j] <-- listNumbers[j - 1];
j <-- j-1;
}
listNumber[j]<-- x;
}
}
Author: KahinaStatus: PublishedQuestion passed 588 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!