Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three-way partioning Quick Sort #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pabloferz
Copy link

@pabloferz pabloferz commented May 28, 2016

This is basically the QuickSort in base with a small change to handle repeated values. It should be less than 1.15x slower than one in base in general but near O(n) time for arrays with few unique keys

CC @kmsquire

@coveralls
Copy link

coveralls commented May 28, 2016

Coverage Status

Coverage increased (+0.2%) to 98.077% when pulling a39c16c on pabloferz:pz/quicksort into 3e666ec on JuliaLang:master.

@pabloferz
Copy link
Author

It seems that the function selectpivot!didn't exist in v0.3. I'm not sure what to do about it. I could define it here but there may be other ways to handle it.

@jiahao
Copy link
Contributor

jiahao commented Jul 6, 2016

At this point it seems like we can just drop 0.3 support.

@tkelman tkelman closed this Feb 2, 2017
@tkelman tkelman reopened this Feb 2, 2017
@ararslan ararslan closed this Mar 12, 2017
@ararslan ararslan reopened this Mar 12, 2017
@xiaodaigh
Copy link

It's been like 4 years. Close it, or merge it or start another repo.

@nalimilan
Copy link
Contributor

I'm willing to merge it if somebody rebases it against master (and tests pass).

@@ -8,6 +8,7 @@
The `SortingAlgorithms` package provides three sorting algorithms that can be used with Julia's [standard sorting API](http://docs.julialang.org/en/latest/stdlib/sort/):

- [HeapSort] – an unstable, general purpose, in-place, O(n log n) comparison sort that works by heapifying an array and repeatedly taking the maximal element from the heap.
- QuickSort3 - an unstable, general purpose, in-place, O(n log n) comparison sort variation of the classic QuickSort that uses a three-way partion algorithm. It can be 1.1x slower than QuickSort in base but works in near O(n) time when there are few unique values in the array.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- QuickSort3 - an unstable, general purpose, in-place, O(n log n) comparison sort variation of the classic QuickSort that uses a three-way partion algorithm. It can be 1.1x slower than QuickSort in base but works in near O(n) time when there are few unique values in the array.
- QuickSort3 - an unstable, general purpose, in-place, O(n log n) comparison sort variation of the classic QuickSort that uses a three-way partitioning algorithm. It can be 1.1x slower than QuickSort in base but works in near O(n) time when there are few unique values in the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants