Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

All the question below refer to the same array. You have to type your answer on

ID: 3910541 • Letter: A

Question

All the question below refer to the same array. You have to type your answer on a single line with one space between each number to get it correct.

The initial array is 7 6 5 4 3 2 1

So if the question was to type in the initial array, you would enter

7 6 5 4 3 2 1

Question 1 (1 point)

What is the contents of the array after 1 pass of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Question 1 options:

Save

Question 2 (1 point)

What is the contents of the array after 2 passes of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Question 2 options:

Save

Question 3 (1 point)

What is the contents of the array after 3 passes of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Question 3 options:

Save

Question 4 (1 point)

What is the contents of the array after 4 passes of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Question 4 options:

Save

Question 5 (1 point)

What is the contents of the array after 5 passes of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Question 5 options:

Save

Question 6 (1 point)

What is the contents of the array after 6 passes of insertion sort (into ascending order?) A single pass includes inserting the selected element in it's correct position
_1_

Explanation / Answer

Insertion sort:

Order the elements in ascending by passing one by one elemet.

Pass 1 : 7 6 5 4 3 2 1 // Only 7 is exist

Pass 2 : 6 7 5 4 3 2 1 // 7>6 re arrange the elements

Pass 3 : 5 6 7 4 3 2 1  // 6>5 re arrange the elements

Pass 4 : 4 5 6 7 3 2 1 // 5>4 re arrange the elements

Pass 5 : 3 4 5 6 7 2 1 // 4>3 re arrange the elements

Pass 6 : 2 3 4 5 6 7 1 // 3>2 re arrange the elements

Pass 7 : 1 2 3 4 5 6 7 // 2>1 re arrange the elements

1.

6 7 5 4 3 2 1

2.

5 6 7 4 3 2 1

3.

4 5 6 7 3 2 1

4.

3 4 5 6 7 2 1

5.

2 3 4 5 6 7 1

6.

1 2 3 4 5 6 7