Skip to content

Commit

Permalink
Add link to bubble sort algorithm (#5541)
Browse files Browse the repository at this point in the history
* Update 100-bubble-sort.md

Adding bubble sort link from w3 school

* Update src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/100-bubble-sort.md

---------

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
  • Loading branch information
the-jahid and kamranahmedse committed Apr 29, 2024
1 parent 9fcf7b7 commit 24ade1c
Showing 1 changed file with 2 additions and 0 deletions.
@@ -1,3 +1,5 @@
# Bubble Sort

Bubble Sort is a simple sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. It gets its name because with each iteration the largest element "bubbles" up to its proper location. It continues this process of swapping until the entire list is sorted in ascending order. The main steps of the algorithm are: starting from the beginning of the list, compare every pair of adjacent items and swap them if they are in the wrong order, and then pass through the list until no more swaps are needed. However, despite being simple, Bubble Sort is not suited for large datasets as it has a worst-case and average time complexity of O(n²), where n is the number of items being sorted.

- [Bubble Sort](https://www.w3schools.com/dsa/dsa_algo_bubblesort.php)

0 comments on commit 24ade1c

Please sign in to comment.