Skip to main content

Bubble Sort

 Let's begin!

Bubble Sort is a Sorting Algorithm which has two parts:

  1. Bubbles up the largest element at the last.
  2. Keep checking if the list is sorted.
One function will keep bringing the biggest elements at the last of the list and another function will recursively calling it until the list is sorted.

Comments

Popular posts from this blog

Insertion Sort

Let's begin! Insertion sort is a Sorting Algorithm which have average time complexity as polynomial square and best case as linear. It has two function: Function which linearly proceeds through array. Helper Function to compare and swap the element if required within the given range. If the function finds that right element is smaller then left element then it will call the helper function to compare and swap the elements if necessary.

Binary Search

 Let's begin! Binary Search is a Searching Algorithm with logarithmic time complexity. It need the list to be sorted,  form the sorted list it goes to the element at the middle.  If the middle element is equal to target it returns true. Else if the target element is less than the middle range then it changes it's range from low to middle and call the function with new parameters. Else if the target element is greater than the middle range then it changes it's range from middle to high and call the function with new parameters. Else returns false.