Skip to content

Commit

Permalink
enh(en): documentation in bubble sort (MakeContributions#868)
Browse files Browse the repository at this point in the history
I add the space Complexity also
  • Loading branch information
ShyamPandit3107 authored Oct 5, 2022
1 parent 25f3e9d commit dec247b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/en/Sorting/Bubble-Sort.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Bubble Sort

Bubble Sort also known as Sinking Sort is the simplest sorting algorithm. It swaps the numbers if they are not in correct order. The Worst Case Time Complexity is O(n^2)

Bubble Sort also known as Sinking Sort is the simplest sorting algorithm. It swaps the numbers if they are not in correct order.
The Worst Case -
Time Complexity : O(n^2)
Space Compldxity : O(1) i.e it use constant space.
## Steps

1. Compares the first element with the next element.
Expand Down

0 comments on commit dec247b

Please sign in to comment.