Skip to main content

Linear Search

 Let's begin!

Linear Search is a Searching Algorithm which search an element inside a list in linear time.
It search element from the starting of a list till the end of the list one by one. 

If the element is found it returns True.

Else it returns False.

Comments

Popular posts from this blog

Bubble Sort

 Let's begin! Bubble Sort is a Sorting Algorithm which has two parts: Bubbles up the largest element at the last. 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.

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.

Jump Search

 Let's begin! It's a Searching Algorithm with average time complexity as root n. Instead of going one by one through elements (like linear search), it jumps from element to element in a sorted array. The jump value is root of the length of array. If target element is found return true. Else If  current element is less than target and within the range call the function with change parameters. Else If  current element is greater than target and within the range call the function with change parameters. Else return false.