Results 1 to 7 of 7
Thread: Quicksort median
- 05-16-2012, 12:25 PM #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.
- 05-16-2012, 12:37 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,380
- Blog Entries
- 7
- Rep Power
- 17
Re: Quicksort median
Read this link.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-16-2012, 05:41 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 25
- Rep Power
- 0
Re: Quicksort median
can someone else explain please what does the exercise want?
- 05-16-2012, 05:47 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,380
- Blog Entries
- 7
- Rep Power
- 17
- 05-16-2012, 07:10 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 25
- Rep Power
- 0
Re: Quicksort median
yeah but I dont get much... :)
- 05-16-2012, 08:28 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,380
- Blog Entries
- 7
- Rep Power
- 17
- 05-16-2012, 10:36 PM #7
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,540
- Rep Power
- 11
Similar Threads
-
Finding the Median
By system5634 in forum New To JavaReplies: 1Last Post: 02-07-2012, 01:30 PM -
Calculating Median and mode
By rochla16 in forum New To JavaReplies: 4Last Post: 04-29-2011, 04:24 AM -
Finding Median of X Integers
By Hasan in forum New To JavaReplies: 3Last Post: 08-12-2008, 02:06 PM -
Quicksort
By little_polarbear in forum New To JavaReplies: 12Last Post: 07-12-2008, 09:20 PM -
Quick sort with median-of-three partitioning
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:40 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks