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

5
votes
2answers
47 views

Pythonic quicksort algorithm

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

Tail recursive sort

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

Potential quicksort optimizations

I implemented qsort() like this. I was wondering what improvements I could do to make it better. ...
6
votes
4answers
224 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
172 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
97 views
2
votes
2answers
134 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
90 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
91 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
72 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 ...
10
votes
1answer
609 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
115 views

Why is my Bubblesort implementation faster than my Quicksort code?

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

QuickSort of Comparable[]

Here is the code for the QuickSort class that I created. ...
7
votes
2answers
93 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
67 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
150 views

Review my F# QuickSort Program

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

Templated Quicksort

Original quicksort.h ...
3
votes
3answers
142 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
357 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
2k 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
146 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
711 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
2k 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
267 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
563 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 ...
0
votes
1answer
109 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
951 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
546 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
4k 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
1k views
7
votes
1answer
1k views

Parallel Quicksort

As my parallel mergesort implementation was very memory dependant, I wanted to write a parallel quicksort one. The algorithm itself is working fine in serial mode, however when I go parallel things ...
7
votes
3answers
501 views

Quick Sort Implementation

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

Quicksort in C++

Here is the implementation I ended up with. Please post your feedback! ...
14
votes
2answers
710 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
499 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 ...
14
votes
5answers
53k 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
471 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
233 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
766 views

Quicksort application

What d'you think bout this code? ...
3
votes
3answers
1k views

Lisp quicksort code

I would really appreciate it if someone could review my quicksort implementation. Additionally, I generated my list dynamically and wrote a couple of tests. Of course, I realize that the tests are ...