enh(en): documentation in bubble sort (#868)

I add the space Complexity also
pull/854/merge
ShyamPandit3107 2022-10-06 04:43:23 +05:30 committed by GitHub
parent 25f3e9dcae
commit dec247b04b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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.