Sorting
The Sorting problem.
The Sorting problem.
Given a list of elements & order operation.
Given a list of elements & order operation.
The mission: Sort the elements following their precedence order.
The mission: Sort the elements following their precedence order.
For example, we know that Quick sort is not really quick when we talk about the worst case data input or worst case pivot choices since it runs on O(n*n). But in practical life, using it "wisely" could result in a relatively fast algorithm of complexity O( n*lgn ) which is nice.
Strangely in the market often slow sorting algorithms are used, in the even in the places where linear sorting algorithms could EASILY be used! but somehow people tend to forget about their existence.
Quick Sort
Merge sort
Bubble sort
We will not discuss it because it is not a good example of anything.
Insertion Sort
Radix Sort
Bucket Sort
Link: