Quicksort is a sorting algorithm invented by C. A. R. Hoare that has an average-case complexity of O(n log n), worst-case complexity of O(n^2). It is one of the fastest general-purpose sorting algorithms in practice.

learn more… | top users | synonyms

4
votes
0answers
224 views

Quicksort async vs serial

I am playing with async and I figured I'd write a parallel implementation of Quicksort while trying to look at various optimizations. I want to keep the generics ...
4
votes
0answers
20 views

Quicksort in SAS for sorting datasets

As a challenge for my own amusement, I decided to write a SAS macro for sorting datasets, deliberately avoiding all of the built-in methods (e.g. proc sort / ...
5
votes
2answers
336 views

QuickSort for a List<T>

I want my QuickSort class to have a static sort method that sort any List for any object that extends Comparable. Have I coded my class correctly? Can I make the use of generics a bit cleaner or is ...
4
votes
3answers
179 views

Plain old quick sort

Any suggestions for improvement are welcome. ...
1
vote
2answers
51 views

Quicksort algorithm

I have reimplemented the quicksort algorithms that takes a list and sorts it in non-decreasing order: ...
4
votes
4answers
182 views

Quick Sort - implementation

Can anything be improved in this code? ...
0
votes
0answers
59 views

Recursive partition sort is inefficient

I have written a recursive method for a partition sort that sorts the array. However, when I use an array of more than 10-20 elements the program takes a really long time to complete. (On my computer ...
3
votes
1answer
78 views

Quicksort - follow-up

This is a follow-up to Quicksort function Like the previous code, this does not optimize for containers with large numbers of duplicate elements. How can I improve this code, particularly with ...
2
votes
0answers
51 views

Haskell in-place quicksort, Ord a => [a] -> IO [a]

As noted below, this is more or less a direct translation from http://rosettacode.org/wiki/Sorting_algorithms/Quicksort#C. I'm fairly satisfied with its readability right now compared to the C code; ...
3
votes
1answer
84 views

Quicksort function

I made a quicksort implementation based on this code. Please review my C++ version. ...
5
votes
2answers
96 views

Implementation of a quicksort function

I am an absolute beginner to programming and am learning it using C. I have just learned function pointers and tried to implement a quicksort function using function pointers to determine the nature ...
2
votes
1answer
63 views

In-place quicksort algorithm in Python 2

I have tried to implement an in-place quicksort Algorithm in Python 2. Please suggest how I can Make the code more efficient Increase readability Improve writing style Make it more Pythonic ...
4
votes
1answer
51 views

Three way Quicksort in Java

What do you think about this implementation of quicksort? Is it possible to make it shorter? ...
5
votes
3answers
96 views

Could this QuickSort be made more consise and “nicer”?

After seeing this example of a "primitive" QS implementation in F# by Scott W ...
7
votes
3answers
133 views

Python implementation of quicksort

My teacher often tells me that I don't take full advantage of Python capabilities, I would like to know if my implementation of Quicksort is good enough and how could I improve it, aside from doing it ...
2
votes
1answer
301 views

Quicksort implementation in Python

I have written an implementation of Quicksort in Python. I am new to Python. Any suggestions for improvement or criticism on my use of Python? ...
1
vote
0answers
64 views

Quick Sort: Mutable or ST Array

This is the most Monadic code I have written to date :-) and I'd welcome comments. I'm also struck how much faster this mutable approach is than the immutable version I first wrote (see end). OK, so ...
26
votes
2answers
2k views

Quicksort implementation seems too slow with large data

I've written a program to compare different sorting algorithms with the array size being 10, 1,000, 100,000, 1,000,000 and 10,000,000. I, of course, expect Insertion to win out on 10 and merge heap ...
5
votes
2answers
76 views

Pythonic quicksort algorithm

Is my implementation of quicksort efficient, in-place, pythonic ? ...
3
votes
1answer
102 views

Determining average of integers using quicksort

I was attempting an online problem given on a programming website which asked us to tell us the number of integers in a given list which can be obtained as an average of any two other integers in that ...
8
votes
2answers
117 views

Quicksort in Python

This is my first actual attempt at writing a Python program. I have a background in C++, so it was a big change (where's my iterators?), and I'm looking for criticism on my use of Python and its ...
2
votes
1answer
92 views

Tail recursive sort

I've heard of this implementation of quick sort (in pseudocode): ...
4
votes
3answers
146 views
4
votes
1answer
49 views

Potential quicksort optimizations

I implemented qsort() like this. I was wondering what improvements I could do to make it better. ...
-1
votes
1answer
170 views
6
votes
4answers
795 views

Comparing pivot choosing methods in quicksort

I have seen various tweaks for quicksort and to establish their usefulness, I designed a program that randomly generates arrays and times how long quicksort takes to sort them. Right now I'm focusing ...
6
votes
2answers
233 views

Testing quicksort user input

I am testing a quicksort implementation. Arrays of random size with random data are passed to quicksort and the return time is averaged out. The user is prompted to enter values for minimum length ...
2
votes
2answers
111 views
2
votes
2answers
247 views

Quicksort implementation in C#

Okay, so I'm a self-taught programmer and have been brushing up on all the 'boring' bits that CS students do that most of us self-taught ignore. Things like Algorithms and Data Structures ...
4
votes
2answers
103 views

Correctness of quick sort in C

What do you think of this piece of code ? This is an implementation of quick sort in C, but I'm not sure about the quality and correctness. ...
2
votes
1answer
239 views

Quick sort implementation in JavaScript in prototype style

I have implemented quickly the quick sort algorithm in JavaScript using prototype based style. The code is rather short (http://jsfiddle.net/b8mfY/): ...
8
votes
2answers
91 views

In place quicksort

I implemented my own sorting in VBA because it doesn't provide its own, and it's healthy to test yourself. It was surprisingly difficult and I ended up make a few tweaks that I didn't expect to make ...
12
votes
1answer
4k views

QuickSort C# Implementation

It has been a while I haven't implemented a QuickSort and I wanted to write it down like I remembered. Here it is: ...
1
vote
1answer
221 views

Why is my Bubblesort implementation faster than my Quicksort code?

Here is my Bubblesort code: ...
7
votes
1answer
287 views

Quicksort implementation

I put together this implementation after playing around with various partitioning- and pivot-strategies, and it runs fine. I wrote this off a version which seemed a bit different from the majority of ...
5
votes
2answers
790 views

QuickSort of Comparable[]

Here is the code for the QuickSort class that I created. ...
7
votes
2answers
115 views

Is this quicksort efficient and acceptable?

In order to complete one of my assignment I needed to include a quicksort so I was wondering if this is correct and acceptable. The code: ...
1
vote
1answer
195 views

Review my F# QuickSort Program

OK... last sort of the day and probably the most fun. F# is really awesome. ...
10
votes
2answers
614 views

Templated Quicksort

Original quicksort.h ...
3
votes
3answers
147 views

I feel as if my quicksort can be made more efficient, but what?

I just learned the quicksort algorithm and tried to implement it, but it feels dirty: ...
1
vote
1answer
653 views

Review of linked list and quick sort

I was trying another approach of sorting a linked list. Aside from the available methods, I've decided to take each node from the linked list and place it into an array. With that, I would be able to ...
3
votes
1answer
3k views

Implementation of quick sort in C#

I'm currently learning programming for the first time and I've created the following implementation of quick sort in C#. I basically read a very basic overview of how quick sort works recursively and ...
1
vote
4answers
151 views

QuickSort critique

This is my first attempt at Quick Sort and am looking for some helpful criticisms on how I can make my code better. Thank you ...
5
votes
2answers
1k views

In-Place Quicksort in Python

Code is below. I'd like to know if this is a solid/efficient implementation of the in-place quicksort algorithm and if my Python style is good (I know there are no comments for now). Code is also on ...
2
votes
2answers
3k views

Simplest quick sort using one 19-line function

This will later be be posted on my website to explain quick sort so I would like how I could improve the readability and simplicity of this demo class. I do not like my use of the stack (meaning this ...
4
votes
1answer
398 views

Help with comparison counters in quick sort algorithm

At the suggestion of @templatetypedef, I am posting the code for my quick sort to see if anyone can offer suggestions as to where to make comparisons. And any tips on improving the code. I am using ...
1
vote
2answers
789 views

Suggestions on improving Sorting Algorithm (Progress ABL/4GL)

I have written some sort routines for PROGRESS 4GL/ABL and wanting to get some input whether these sorts can be improved. And whether my sorts are true to name. And I would also be very interested in ...
3
votes
1answer
1k views

Quicksort using pointers

As an exercise, I've written quicksort algorithm in C using pointers. Please comment and help me find the cases where it breaks (if any). ...
1
vote
2answers
629 views

Quicksort in Ruby!

I've been teaching myself Ruby this weekend. First of all, I am aware that there is a built-in sort function. I've written this code strictly as an exercise. I have background primarily in C# and ...
4
votes
3answers
5k views

My version of C++ quicksort

I built my code according to the algorithm provided in this YouTube video. http://www.youtube.com/watch?v=y_G9BkAm6B8 The file attached is my code, please review it and help me find the problem. It ...