Which simple sort is the following sorting code frompublic v

Which simple sort is the following sorting code from?//--------------------------------------------------------------public void mysterySort() {int in, out; for(out=1; out0 && a[in-1] >= temp)//until one is smaller, {a[in] = a[in-1];//shift item to right -in;//go left one position} a[in] = temp;//insert marked item}//end for}//end mysterySort()//------------- Bubble Sort Selection Sort Insertion Sort Quick Sort

Solution

This simple sort is implementation of Insertion Sort. Since in algorithm all elements are shifted till proper place of an element is found and then that is inserted.

 Which simple sort is the following sorting code from?//--------------------------------------------------------------public void mysterySort() {int in, out; fo

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site