# Thread: Quicksort median

1. Member
Join Date
Mar 2011
Posts
25
Rep Power
0

## Quicksort median

Hello. I have an excercise that asks the following:
Consider a modification to QuickSort, such that each time "Partition" is called, the median of the portioned array is found and used as a pivot. Write a pseudocode fo that.

I'm not asking for the answer. I just want to know what the median is. Is it the number that splits the array in half?
i.e: In case of (1,2,3,4,5,6,7,8,9) the median is 5?
Thank you.

2. ## Re: Quicksort median

Read this link.

kind regards,

Jos

3. Member
Join Date
Mar 2011
Posts
25
Rep Power
0

## Re: Quicksort median

can someone else explain please what does the exercise want?

4. ## Re: Quicksort median

Originally Posted by louboulos
can someone else explain please what does the exercise want?
Have you read the link I gave you?

kind regards,

Jos

5. Member
Join Date
Mar 2011
Posts
25
Rep Power
0

## Re: Quicksort median

yeah but I dont get much... :)

6. ## Re: Quicksort median

Originally Posted by louboulos
yeah but I dont get much... :)
Don't just skim over it but study the material; there's even very clear pseudo code in there. We are not going to spoonfeed you ...

kind regards,

Jos

7. Moderator
Join Date
Feb 2009
Location
New Zealand
Posts
4,712
Rep Power
15

## Re: Quicksort median

I just want to know what the median is. Is it the number that splits the array in half?
Yes, more or less. For the precise definition read the "median" link in the second sentence of the Wikipedia article you have already been pointed at.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•