Supposed you used quick sort and you are done on the FIRST PARTITIONING and the array looks like this: [3, 5, 2, 6, 8, 15, 21, 11). Which of the following statements is true? O The pivot is 8 O The pivot could be either the 6 or the 8. O Neither the 6 nor the 8 is the pivot. O The pivot is 6.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 9RQ
icon
Related questions
Question

Pls. answer the 2 questions. write a short explanation each. 

Supposed you used quick sort and you are done on the FIRST PARTITIONING and the array looks like this: [3, 5, 2, 6, 8, 15, 21, 11]). Which of the following statements
is true?
O The pivot is 8
O The pivot could be either the 6 or the 8.
O Neither the 6 nor the 8 is the pivot.
O The pivot is 6.
Transcribed Image Text:Supposed you used quick sort and you are done on the FIRST PARTITIONING and the array looks like this: [3, 5, 2, 6, 8, 15, 21, 11]). Which of the following statements is true? O The pivot is 8 O The pivot could be either the 6 or the 8. O Neither the 6 nor the 8 is the pivot. O The pivot is 6.
[32, 15, 12, 11, 18, 16, 4, 2, 24] if this is our input array, and we chose 24 as pivot, it will end up at what position?
index 5
index 7
index 8
O index 6
Transcribed Image Text:[32, 15, 12, 11, 18, 16, 4, 2, 24] if this is our input array, and we chose 24 as pivot, it will end up at what position? index 5 index 7 index 8 O index 6
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,