**By: Saurav**

**2018-04-10 03:35:00 UTC**

We all have been there, done that. Well! This one is a refresher.

Bubble sort is all about bubbling the greatest element in each iteration. For sure we can do n iterations for array of size n but we can be more efficient by iterating till n-i in the i+1 round.

This is O(n^2) in Time complexity and O(1) in space

Few questions to ask before starting would be:

What's the size of the array

What's the element of the array? Float, Integer, Positive Negative, Characters etc?

Can an array be of only 1 or 0 elements?

let's write the tests and see the code:

Owned & Maintained by Saurav Prakash

If you like what you see, you can help me cover server costs or buy me a cup of coffee though donation :)