sohamm20 / Hacktoberfest_2022_MMCOE

The purpose of this repository is to help and motivate students to contribute in open source, Also encourage them to complete the hacktoberfest 2022
1 stars 22 forks source link

Bubble Sort Algorithm #42

Closed Deven1902 closed 1 year ago

Deven1902 commented 1 year ago

Working – Step 1 – Starting with the first element(index = 0), compare the current element with the next element of the array. Step 2 – If the current element is greater than the next element of the array, swap them. Step 3 – If the current element is less than the next element, move to the next element. Step 4 – Repeat Step 1 till the list is sorted.

Time Complexity:- O(n2)