Question & Answer: Consider the following C code snippet: for (i=0: i…..

9) Consider the following C code snippet: for (i-0; i < 4; i++) in -ii for (k “ i + 1; k< 5; k++) if (alin] > a[kl) in-k: if (in !“ i) copy atil: a(c] -alin]: alin] copy: The sorting technique for the above code is? a) Insertion sort b) Merge Sort cSelection sort d) Swap sort 3

Consider the following C code snippet: for (i=0: i

Expert Answer

 

Answer is c (selection sort)

selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from the unsorted part and putting it at the beginning

Still stressed from student homework?
Get quality assistance from academic writers!