The effectivity of any sorting algorithm is decided by time complexity & house complexity of the algorithm.
Now you’ve gotten some questions in your thoughts that what’s Time Complexity and House Complexity.
Time Complexity refers back to the time taken by an algorithm to finish its execution with respect to the dimensions of the enter.
It may be represented in several varieties :-
Huge O notation represents the higher certain of the operating of an algorithm. Thus, it offers the worst case complexity of an algorithm. It’s widly used to research an algorithm as we’re at all times within the worst-case situation.
Omege notation represents the decrease certain of the operating time of an algorithm. Thus, it offers the finest case complexity of an algorithm.
Theta notation encloses the perform from above and beneath. It’s used to analyzing the common case complexity of an algorithm.
House complexity refers back to the whole quantity of reminiscence utilized by the algorithm for an entire execution. It contains each the auxiliary reminiscence and the enter.
The auxiliary reminiscence is the extra house occupied by the algorithm other than the enter knowledge. Often auxiliary reminiscence is used for calcuting the house complexity of an algorithm.
A sorting algorithm is taken into account secure if the 2 or extra objects with the identical worth preserve the identical relative positions even after sorting.
I hope you’ll perceive Time Complexity, House Complexity and Stability. In our upcoming blogs, we are going to talk about extra about Knowledge Construction like LinkedList, Stack & Queue and so forth.