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
1answer
40 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
93 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
110 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
90 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
45 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
61 views

Pythonic quicksort algorithm

Is my implementation of quicksort efficient, in-place, pythonic ? ...
3
votes
1answer
97 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
100 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
82 views

Tail recursive sort

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

Potential quicksort optimizations

I implemented qsort() like this. I was wondering what improvements I could do to make it better. ...
6
votes
4answers
483 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
209 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
104 views
2
votes
2answers
209 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
98 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
169 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
81 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 ...
11
votes
1answer
3k 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
170 views

Why is my Bubblesort implementation faster than my Quicksort code?

Here is my Bubblesort code: ...
7
votes
1answer
250 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
637 views

QuickSort of Comparable[]

Here is the code for the QuickSort class that I created. ...
7
votes
2answers
99 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
0answers
88 views

How does this specific quicksort work? [closed]

I am in school and we are learning sorting algorithms. After quite some struggle, I've managed to create this with the modest help of some googling skills. It has been quite some time and I now no ...
1
vote
1answer
189 views

Review my F# QuickSort Program

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

Templated Quicksort

Original quicksort.h ...
3
votes
3answers
144 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
542 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
149 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 ...
1
vote
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
374 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
686 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 ...
-1
votes
1answer
118 views

Does this QuickSort implementation still hold the O(N logN) complexity? [closed]

As noted from wiki, I know the average time complexity of the QuickSort algorithm is O(N logN). Does my implementation still holds ...
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
606 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 ...
6
votes
2answers
2k views
10
votes
1answer
1k views

Parallel Quicksort

As my parallel mergesort implementation was very memory dependent, I wanted to write a parallel quicksort one. Here it comes: ...
7
votes
3answers
550 views

Quick Sort Implementation

I have written the below code for quick sort in Java: ...
7
votes
4answers
594 views

Quicksort in C++

Here is the implementation I ended up with. Please post your feedback! ...
14
votes
2answers
781 views

Is this C++ quicksort program okay?

I wrote a quicksort program in C++. Is it okay to implement it this way? Am I using pointers correctly? Is my style okay? Any ideas to speed it up or save memory? ...
2
votes
1answer
548 views

More Generic Sorting Algorithm: Using Namespaces

I am currently reading The C++ Programming Language (Special Edition) and am learning about using templates. One of the exercises asks you to program a generic version of quick sort. I am hoping to ...
15
votes
5answers
56k views

Java Implementation of Quick Sort

This is my implementation of quick sort (algorithm taken from Cormen book). This is an in place implementation.Please let us know issues with this or any ideas to make it better. It performs at logN ...
2
votes
1answer
4k views

Handling duplicate keys in quicksort

A naïve quicksort will take O(n^2) time to sort an array containing no unique keys, because all keys will be partitioned either before or after the pivot value. There are ways to handle duplicate keys ...
2
votes
4answers
507 views

My own quicksort algorithm

I will make it more reader friendly after I get the algorithm completed. Does anything with the quick sort algorithm stand out as for why it is not working 100%? This is not homework; I am just ...
2
votes
5answers
238 views

Please make some comment about this code of QuickSort.

Please make some comment about this code of QuickSort. My code is based on the example shown in this book. ...
5
votes
3answers
786 views

Quicksort application

What d'you think bout this code? ...