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

Having a hard time understanding these ones. Any help is greatly appreciated! In

ID: 3869243 • Letter: H

Question

Having a hard time understanding these ones. Any help is greatly appreciated!

Information 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 2 3 4 567 81 So if the question was to type in the initial array, you would enter 23 456781 Question 1 (1 point) roofthe .may fter 1 pass of seiection .ort (in to-scending onde?) Asnge pas, ne des both. search and a swap Save Question 2 (1 point) What is the contents of the array after 2 passes of selection sort (into ascending order?) A single pass includes both a search and a swap. Save Question 3 (1 point) What is the contents of the array after 3 passes of selection sort (into ascending order?) A single pass includes both a search and a swap. Save

Explanation / Answer

Solution:

The array gets completely sorted in total 7 passes.

You can refer to the following pseudo code of selection sort in java to get the array contents of each pass.

Contents of array after 1 pass 1 3 4 5 6 7 8 2 Contents of array after 2 pass 1 2 4 5 6 7 8 3 Contents of array after 3 pass 1 2 3 5 6 7 8 4 Contents of array after 4 pass 1 2 3 4 6 7 8 5 Contents of array after 5 pass 1 2 3 4 5 7 8 6 Contents of array after 6 pass 1 2 3 4 5 6 8 7
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote