# Tagged Questions

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.

25 views

### Quicksort using first element pivot

I'm trying to get my Quicksort implementation doing fewer comparisons. The first element is used as a pivot. Could you give me some directions if there are any places that should be optimized in a ...
32 views

### Quicksort using uniform_int_distribution to select the pivot

I have not used C++ for a while. Could you please tell me if my usage of the <random> module is correct? I am not sure if I need to be creating a new instance ...
102 views

### Quick Sort in Java

I recently started learning about algorithms and data structure's. I decided that for every algorithm I learn about I'll implement it without looking at any pseudo code or actual code. I have ...
68 views

### QuickSort C++ Implmentation using Iterators #2

This is part 2 of the previous question asked which is at - QuickSort C++ Implementation using Iterators. Based on Jerry Coffin's answer, I have made the changes except for using templates. ...
42 views

### Quick sort implementation

Please look the code below ...
187 views

### QuickSort C++ Implementation using Iterators

I implemented quicksort using iterators. I am will be grateful, if someone can review my piece of code. BTW, I am just selecting the last element as the pivot (which I plan to randomize later) I am ...
46 views

### Quicksort implementation in Go

Learning Go and trying to get a grip of the various concepts it uses. Following is my implementation of Quicksort (choosing last element as pivot). It takes the length of the array and the subsequent ...
70 views

### C++11 Quicksort any container

As the title says, simple quicksort to help myself get used to C++ templates and iterators. Main concern is whether there's a better way to template so that you can have a simple function (e.g. ...
48 views

### Median of 3 Quicksort in C

I'm trying to re-implement the C stdlib function qsort using a median of 3 quicksort. ...
92 views

### Quicksort implementation in Java

I wrote this implementation of quicksort as a bit of practice and review for myself. I did not base my algorithm on anything more than my own understanding of quicksort and working through a couple ...
281 views

### Parallel integer Quicksort in Java

Now I have that parallel Quicksort for (primitive) integer arrays. ParallelIntQuicksort.java: ...
75 views

### Faster QuickSort

I'm trying to make my QuickSort faster than it is and I have got no more ideas about how to make it more efficient for all types of arrays but mostly very big arrays. It uses random to create the ...
89 views

### Quicksort for a pseudosite

I have a pseudosite, where I actually post small functions, so that I can re-use them*, but some posts have visitors. The top is Quicksort (C++). I feel that beginners visit it, so I do not care in ...
564 views

### Integer quicksort in Java

I have this Quicksort implementation that sorts arrays of int (not Integer). It has comparable performance to Java's ...
205 views

### Multi-dimensional array sort and filter functions

As I said in my last post Multi-dimensional ascending and descending sort array function, I'm back with the final version of the code. Added features: Filter array function by following parameters: ...
208 views

### Quicksort for strings in Java

I have this implementation of Quicksort for strings. The algorithm sorts the requested range by first character, then by second, third, and so on. (Please, do not confuse this with radix sort; it is ...
79 views

### Java Quicksort Algorithm

I am trying to work on writing readable code and reducing the amount of redundant code I write. I find this hard to do especially when it comes to algorithms. So, I wrote a quicksort program to ...
89 views

### A simple quicksort implementation

I have the following class for Quicksorting. ...
39 views

### Forth to the past - qsort

To make a long story short, I must revive my Forth. It is rusty; last time I did anything serious in Forth was 30 years ago (man, I am old). As an exercise, I translated an STL-like implementation of <...
119 views

### Big O notation for quicksort implementation [closed]

I am trying to find out what would be the Big O notation of a quick sort implementation I wrote. If I can get some analysis on the code, that would be great. ...
252 views

### Nuts and bolts algorithm

I am trying to learn Golang. This is a problem from Robert Sedgewick's Algorithms book: You have a mixed pile of N nuts and N bolts and need to quickly find the corresponding pairs of nuts ...
254 views

### Is this implementation of Quicksort good?

For fun, I decided to implement the quickest Quicksort I could. This is what I came up with. How can I make it better? I know that it's slower for sorted and already reversed lists (through testing), ...
69 views

### Suffix Array Construction

I'm trying to implement a suffix array for use in programming competitions. I'm using the CodeForces example and trying to "make it my own" so I can make sure I understand it and feel better about ...
239 views

### QuickSort in Java

I've written my first implementation of quicksort in Java 8. Please let me know of any improvements that I can make (e.g. whether I'm creating any Lists ...
350 views

### Implementation of quicksort algorithm

I'm currently doing an algorithms course and implemented this version of the quicksort algorithm. I would like to know if it is an efficient implementation. I've seen a couple others where there is a ...
74 views

### Classic sorting algorithms [closed]

I implemented the classic Sorting Algs in JS for practice. I come from a C++/Java background. Just wanted to make sure I didn't miss anything or if there was a 'better' JS way of doing it. Also, I ...
752 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 (...
168 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 / ...
935 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 ...
215 views

### Plain old quick sort

Any suggestions for improvement are welcome. ...
94 views

### Quicksort algorithm

I have reimplemented the quicksort algorithms that takes a list and sorts it in non-decreasing order: ...
51k views

### Quick Sort - implementation

Can anything be improved in this code? ...
193 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 ...
120 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 ...
190 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; ...
114 views

### Quicksort function

I made a quicksort implementation based on this code. Please review my C++ version. ...
230 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 ...
88 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 <...
102 views

### Three way Quicksort in Java

What do you think about this implementation of quicksort? Is it possible to make it shorter? ...
105 views

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

After seeing this example of a "primitive" QS implementation in F# by Scott W ...
255 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 ...
2k 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? ...
189 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 ...
3k 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 ...
175 views

### Pythonic quicksort algorithm

Is my implementation of quicksort efficient, in-place, pythonic ? ...
109 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 ...
162 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 ...
155 views

### Tail recursive sort

I've heard of this implementation of quick sort (in pseudocode): ...