logo CodeStepByStep logo

InsertionSort2

Language/Type: C# insertion sort sorting
Related Links:

Write the state of the elements of the list below after the first three odd passes of the outermost loop of the insertion sort algorithm.

// index     0   1   2   3   4   5   6  7
// values  {35, 33, 72, 13, 91, 42, 13, 2}
List<int> numbers = new List<int> {35, 33, 72, 13, 91, 42, 13, 2};
InsertionSort(numbers);
after pass 1
after pass 3
after pass 5

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.