Sorting Algorithms and Big O
-
There are numerous sorting algorithms, e.g
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort and so on...
-
The Big O notation is a relative representation of the complexity of an algorithm.
-
Time complexity of an algorithm is the amount of time taken by an algorithm to run as a function of the full length of input. In other words it is the amount of processes that ran to complete a certain task.
-
Different algorithms have their relative advantages over one another in terms of time complexity, memory consumed, size of datasets and so on. Selecting the right algorithm for a task requires consideration of all these factors.
-
A stable sorting algorithm is one that maintains relative order of data with equal values. This means that if two elements are equal, Their order will be preserved at the end of the process. (e.g Bubble Sort, Insertion Sort, Merge Sort, Count Sort, etc)