Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3 (Sorting) (16 points = 4*4 points) An int array stores the following values. Use the array to answer the following Multiple Choice questions.
Question 3 (Sorting) (16 points = 4*4 points) An int array stores the following values. Use the array to answer the following Multiple Choice questions. 3.1) Which of the following lists of numbers would accurately show the array after the first pass through the Insertion Sort algorithm? A) 9, 4, 12, 2, 6, 8, 18 B) 4, 9, 12, 2, 6, 8, 18 C) 2, 4, 12, 9, 6, 8, 18 D) 2, 4, 6, 8, 9, 12, 18 E) 2, 4, 9, 12, 6, 8, 18 3.2) Which of the following lists of numbers would accurately show the array after the second pass of the Insertion Sort algorithm? A) 9. 4, 12, 2, 6, 8, 18 B) 2, 4, 9, 6, 12, 8, 18 C) 4, 9, 12, 2, 6, 8, 18 D) 2, 4, 6, 8, 9, 12, 18 E) 2, 4, 12, 6, 8, 9, 18 3.3) Which of the following lists of numbers would accurately show the array after the fourth pass of the Insertion Sort algorithm? A) 9, 4, 12, 2, 6, 8, 18 B) 2, 4, 6, 9, 12, 8, 18 C) 2, 4, 6, 8, 9, 12, 18 D) 2, 4, 6, 9, 8, 12, 18 E) 2, 4, 9, 12, 6, 8, 18 3.4) How many passes will it take until the Insertion Sort algorithm terminates? (Remember, although the array may get sorted, selection algorithm will not stop until it terminates) A) 2 B) 4 voa
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started