Stony Brook Algorithm Repository


Sorting

Input
Output

Input Description: A set of \(n\) items.
Problem: Arrange the items in increasing order.

Excerpt from The Algorithm Design Manual: Sorting is the fundamental algorithmic problem in computer science. Learning the different sorting algorithms is like learning scales for a musician. Sorting is the first step in solving a host of other algorithm problems. Indeed, ``when in doubt, sort'' is one of the first rules of algorithm design.

Sorting is also used to illustrate the standard paradigms of algorithm design. The result is that most programmers are familiar with many different sorting algorithms, which sows confusion as to which should be used for a given application.


Implementations

libc++ (rating 10)
libstdc++ (rating 10)
OpenJDK 10 (rating 10)
Python Standard Library (rating 10)
Go Standard Library (rating 10)
BSD Sort (rating 10)
GNU Coreutils (rating 10)
C++ STL (rating 10)
CoSort (rating 9)
Syncsort (rating 9)
Ordinal Technology: Nsort (rating 9)


Recommended Books

Algorithms in Java, Third Edition (Parts 1-4) by Robert Sedgewick and Michael Schidlowsky Compared to What? by G. Rawlins Combinatorial Search by M. Aigner
Programming Pearls by J. Bentley

Related Problems


Convex Hull

Dictionaries

Median and Selection

Priority Queues

Searching

Topological Sorting


As an Amazon affiliate, I earn from qualifying purchases if you buy from links on this website.


Go To Main Page