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

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

ID: 3918968 • Letter: S

Question

Subsection

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_

Question 6 options:

Save

Explanation / Answer

ANSWER:

According to the given solution the below data follows;

àBy taking the one by one element order it in ascending

For Pass one : 7 6 5 4 3 2 1 àhere Only 7 exist’s

For Pass two : 6 7 5 4 3 2 1 àhere rearrange the elements that is for 7>6

For Pass three : 5 6 7 4 3 2 1  à here rearrange the elements that is for 6>5

For Pass four : 4 5 6 7 3 2 1 à here rearrange the elements that is for 5>4

For Pass five : 3 4 5 6 7 2 1 -->here rearrange the elements that is for 4>3

For Pass six : 2 3 4 5 6 7 1 à here rearrange the elements that is for 3>2

For Pass seven : 1 2 3 4 5 6 7 à here rearrange the elements that is for 2>1

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

Thus our required output is obtained