Choose a Pivot Using Median of Three

Using the median-of-three method , select a pivot to use to quicksort the following array:

A = [ 5 , 6 , 33 , 129 , 16 , 22 , 8 , 31 , 24 ] . A = [5,6,33,129,16,22,8,31,24].

5 16 24 129

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Karleigh Moore
Mar 23, 2016

The first element is 5, the middle element is 16, and the last element is 24. The median of these three numbers is 16.

the quiz says 16 is wrong, and points out at 5 grr

Prashanth Thiaga - 2 years, 9 months ago

Log in to reply

Exactly! Annoying!

Raja Hejamadi - 2 years, 8 months ago

Answer still incorrect 4/24/19.

Blake Harlan - 2 years, 1 month ago

Log in to reply

Answer still incorrect 10/17/20.

The answer is wrong. It should be 16 right?

Hristo Georgiev - 1 year, 6 months ago

the quiz says that 16 is wrong!!!

sarah X - 1 year ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...