Wizard-Of-Docs
Wizard-Of-Docs copied to clipboard
Add Bubble Sort algorithm
Description
Hi! I am willing to add a bubble sorting algorithm to this repo. The concept of bubble sort is to compare each adjacent pair of elements and swap them if they don't follow the order. While bubble sort is not an efficient way of sorting, it is one of the most classical approaches to sorting.
Example: Input: [2, 9, 4, 1, 0] Output: [0, 1, 2, 4, 9]
Expected time complexity: O(N^2), where N is the number of elements in the input array. Expected space complexity: O(1)
Programming language
- [ ] C
- [ ] C++
- [ ] Java
- [x] Python
Are you contributing under any open-source program?
I am participating in Hacktoberfest 2021. Hence, I am contributing to this repo as a part of it. 😄