Ad Block Detected!
Our website is made possible by displaying ads to our visitors. Please support us by whitelisting our website or allowing necessary trackers.
Our website is made possible by displaying ads to our visitors. Please support us by whitelisting our website or allowing necessary trackers.
A bubble sort is a type of sorting algorithm that sorts an unordered list.
A bubble sort works by swapping adjacent items until it's in order. It's the most inefficient of the sorting algorithms but it's easy to implement. As a result it is often used for small data sets. The time complexity of a bubble sort is O(n^2).
A merge sort is a type of sorting algorithm that sorts an unordered list using a divide and conquer method.
A merge sort halves the lists up until they are in pair.
A linear search is a type of searching algorithm that sequentially checks each element of the list until a match is found. It has a time complexity of O(n).
A binary search is a type of searching algorithm that finds an item in a sorted list by a method of divide and conquer.
In a binary search, the midpoint of the item is found and from there, it checks if the desired value is greater than or less than that value. In the binary search example below, the number 4 is the value we are looking for and the red items are the values that are not needed. A binary search has a time complexity of O(Log n).