Wizard-Of-Docs icon indicating copy to clipboard operation
Wizard-Of-Docs copied to clipboard

Add Bubble Sort algorithm

Open das-jishu opened this issue 2 years ago • 2 comments

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


das-jishu avatar Oct 01 '21 04:10 das-jishu