![]() |
|
#1
|
|||
|
|||
Median of Three Quick SortHello to all expert developer, i looking for this algorithm.
I already wrote the simplest qs which pivot is first element in list but this sort is extremely inefficient and almost same with selection sort. Therefore, i looking for Median of Three Quick Sort. Thanks in advance for any help. |
|||
|
#2
|
|||
|
|||
Re: Median of Three Quick Sorther you go
Of course, I have not tested it or even looked at the implementation. There are comments there though... __________________
My personal site: Utilities for text processing, debugging, testing and plotting |
|
#3
|
|||
|
|||
Re: Median of Three Quick SortI will have a look.
Thanks. |
|
#4
|
|||
|
|||
Re: Median of Three Quick SortI have code it but seems some logic error inside.
Below is is my code: CPP / C++ / C Code:
Thanks. |
|
#5
|
|||
|
|||
Re: Median of Three Quick SortWhat is the error. How do you think it is misbehaving - that is, what input is it not properly sorting?
You provide very little input (or any question) to guide us in which direction you wish to receive assistance. What is it you are having trouble with, specifically? __________________
My personal site: Utilities for text processing, debugging, testing and plotting |
|
#6
|
|||
|
|||
Re: Median of Three Quick SortQuote:
There are logic error within my program. Yes, They can sorted about 80% of the input only. Help is pretty appreciated by me. |
|
#7
|
|||
|
|||
Re: Median of Three Quick SortAn example of what is NOT sorting would be helpful (the pre-sort and post-sort items would be what is required).
None of us here has a crystal ball with which to look into your mind - details will go a long way in helping us help you with your problem. __________________
My personal site: Utilities for text processing, debugging, testing and plotting |
|
#8
|
|||
|
|||
Re: Median of Three Quick SortProblem solved.
The problem now is when the element is less than certain CUTOFF, then i called insertionSort but also won't sort it nicely. The insertion Sort is works in another program. The C++ STL is intro sort which called quick sort, heap sort and insertion sort. Below is my code CPP / C++ / C Code:
Thanks for your help. |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge sort on a linked list | Temujin_12 | C++ Forum | 1 | 06-Mar-2008 21:33 |
| Quick sort | thagafnh | C++ Forum | 0 | 20-Oct-2007 19:47 |
| Quick Sort Algorithm | Peter_APIIT | C++ Forum | 3 | 03-Oct-2007 23:45 |
| Help quick sort template | shinx | C++ Forum | 1 | 11-Dec-2006 15:00 |
| SORT / ORDER BY multi columns in MySQL | misunderstood | MySQL / PHP Forum | 3 | 01-Oct-2003 10:01 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The