From 8c4ead7998ea7def4ace03e6641071f2678fe2cb Mon Sep 17 00:00:00 2001 From: Ha Anh Nguyen Date: Wed, 31 Oct 2018 05:20:10 +0200 Subject: [PATCH] Add special cases where bubble sort is reasonable (#20527) I added more specific explanations when bubble sort is used --- .../english/algorithms/sorting-algorithms/bubble-sort/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/english/algorithms/sorting-algorithms/bubble-sort/index.md b/guide/english/algorithms/sorting-algorithms/bubble-sort/index.md index 05d49f218ca..38b35c2c612 100644 --- a/guide/english/algorithms/sorting-algorithms/bubble-sort/index.md +++ b/guide/english/algorithms/sorting-algorithms/bubble-sort/index.md @@ -5,7 +5,7 @@ title: Bubble Sort Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. -This is a very slow sorting algorithm compared to algorithms like quicksort, with worst-case complexity O(n^2). However, the tradeoff is that bubble sort is one of the easiest sorting algorithms to implement from scratch. +This is a very slow sorting algorithm compared to algorithms like quicksort, with worst-case complexity O(n^2). However, the tradeoff is that bubble sort is one of the easiest sorting algorithms to implement from scratch. As a result, bubble sort algorithm is commonly taught as the first sorting algorthim in Algorithm and Data structure classes. From technical perspective, bubble sort is reasonable for sorting small-sized arrays or specially when executing sort algorithms on computers with remarkably limited memory resources. ### Example: