A sorting algorithm arranges elements according to an ordering criterion. Sorted data matters because binary search depends on it; selection sort is introduced as a first sorting method and a stepping stone to quicksort. section 1.4 section 2.0
Sorting algorithm
A sorting algorithm is an algorithm that arranges elements according to an ordering criterion.
How Grokking Algorithms, Second Edition covers it
- How deep it goes
- Positions selection sort as preparation for quicksort, without detailing its procedure in this coverage.
- Examples
- Uses an alphabetized phone book to illustrate how sorted data supports binary search.
- What it assumes
- Assumes familiarity with Big O notation and logarithms for performance analysis.
- What you can do after
- Understand how sorted data enables binary search and why selection sort prepares readers for quicksort.
- How it connects
- Connects sorting to binary search, arrays, linked lists, and quicksort.
Also explained in
-
Pandas Workout: 200 exercises to make you a stronger data analystSorting orders tabular records according to the values of an index or one or more columns.
-
MongoDB 8.0 in Action, Third EditionSorting is the ordering of query results according to one or more document fields.
-
Secrets of the JavaScript Ninja, Second EditionAn Array method that sorts an array in place using a comparison function or default ordering.
-
Python How-ToSorting is the process of arranging elements into an order determined by a comparison or key function.
-
Python Workout, Second EditionSorting is the technique of arranging elements according to an ordering determined by their values or derived comparison keys.
-
Tiny Python Projects: Learn coding and testing with puzzles and gamesSorting is the operation of arranging collection elements according to an ordering criterion.
-
Building Web APIs with ASP.NET CoreSorting is the ordering of query results according to one or more specified fields or expressions.
-
Python Workout: 50 ten-minute exercisesSorting is the technique of arranging elements according to an ordering determined by their values or derived comparison keys.
-
The Design of Web APIs, Second EditionSorting is the technique of ordering returned items according to one or more specified fields and directions.
-
Clojure: The Essential ReferenceThe arrangement of elements into an order determined by a comparison criterion.
-
Java Persistence with Spring Data and Hibernate epubSorting is the ordering of query results according to one or more attributes.
-
D3.js in Action, Third Editionsort() is the JavaScript Array method that orders array elements according to an optional comparison function.
-
Learn SQL in a Month of LunchesResult ordering is the specification of the sequence in which rows are returned by a query.
-
100 SQL Server Mistakes and How to Avoid ThemA sort operation arranges rows according to specified ordering keys during query execution or index maintenance.
-
Learn Go with Pocket-Sized ProjectsSorting is the technique of ordering elements in a collection according to a specified comparison criterion.
-
Build a Website with ChatGPTSorting is the operation of arranging data records or values according to an ordering criterion.
Compare how 18 books explain sorting algorithm →
Related concepts
- quicksortincludes · Quicksort is a comparison-based sorting algorithm that partitions elements around a pivot and recursively sorts the resulting subranges.
- heapsortincludes · Heapsort is a comparison-sorting algorithm that uses a heap to repeatedly select elements and produce an ordered sequence.
- shufflecontrasts with · Shuffling is the random rearrangement of elements in a collection, sequence, or dataset.
- listuses · A list is an ordered collection of elements arranged in a sequence.
- comparison functionuses · A comparison function or strategy compares two values and indicates their relative ordering, and sometimes whether they are equivalent.
- sortedcontrasts with · sorted is a Python built-in function that returns a new list containing an iterable’s elements in sorted order without modifying the original iterable.
This explainer was generated by Manning's knowledge graph from the text of Grokking Algorithms, Second Edition. The section links point to the parts of the book it draws on.

















