Q3 B
Sameh
c_cpp
2 years ago
282 B
7
Indexable
void insertionSort(int *a , int n)
{
int temp , j;
for (int i = 1 ; i < n ; i++)
{
temp = a[i];
j = i - 1;
while(j >= 0 && a[j] > a[i])
{
a[j + 1] = a[j];
j--;
}
a[j+1] = temp;
}
}Editor is loading...
Leave a Comment