Algorithm

Bubble Sort

Sorting Algorithm

A simple comparison sort that repeatedly steps through a list, swapping adjacent elements that are out of order, so that larger elements bubble toward the end; easy to explain but quadratic in time, so mostly a teaching example rather than a production sort.

Facts
Credited To
Edward Harry Friend (earliest description, 1956) 2
Space Complexity
Constant 3
Classification
Design Technique
Brute Force 1
Time Complexity
Time Complexity (category)
Quadratic Time -- O(n^2) 1
Connections

In Field

Uses Design Technique

Sources
1. Bubble Sort (Wikipedia)
  • Wikipedia infobox: time complexity quadratic
    quadratic
  • Wikipedia: design technique brute-force
    brute-force
View the Source
2. Wikipedia, Bubble sort
  • History
    The earliest description of the bubble sort algorithm was in a 1956 paper by mathematician and actuary Edward Harry Friend, Sorting on electronic computer systems, published in the third issue of the third volume of the Journal of the Association for Computing Machinery (ACM), as a "Sorting exchange algorithm."
  • In Group: Comparison Sorting Algorithms, Lead section
    comparing the current element with the one after it
View the Source
3. Big-O Cheat Sheet: Big-O Cheat Sheet
Big-O Cheat SheetArray Sorting Algorithms table
Quote, Array Sorting Algorithms table
Bubble Sort Ω(n) Θ(n^2) O(n^2) O(1)
View the Source
Wikidata: Bubble Sort
Wikidata Q60864View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.

Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme