Pros:
Simplicity and ease of implementation.
Cons:
Horribly inefficient.
Ideas of Bubble sort
Rough ideas:
Pros:
Relatively simple and easy to implement.
Cons:
Inefficient for large lists.
Ideas of Insertion sort
– The approach of Insertion Sort:
It has to pick any value and insert it into its proper place in a
sorted sublist
Repeat until all values have been inserted
For more detail:
Consider the first item to be a sorted sublist (of one item)
Insert the second item into the sorted sublist,
shifting the first item as needed to make room to insert the
new addition
Insert the third item into the sorted sublist (of two items),
shifting items as necessary
Repeat until all values are inserted into their proper positions
Selection sort
Rough ideas:
=> O(n*n)
=> The selection sort works by selecting the
smallest unsorted item remaining in the list, and then
swapping it with the item in the next position to be
filled. The selection sort has a complexity of O(n2).
Pros:
Simple and easy to implement.
Cons:
Inefficient for large lists, so similar to the more
efficient insertion sort that the insertion sort should be
used in its place.
Shell sort
Rough ideas:
Pros:
Efficient for medium-size lists.
Cons:
Somewhat complex algorithm, not nearly as efficient as
the merge, heap, and quick sorts.
Comparison of low level sorts
High Level sorts
Quick Sort
Quick sort
Worst case of Quick sort
Bubble sort
quick sort
➔ if most of element of an array are unique
➔ If an array is already sorted
➔ If an array is already sorted in a descending order
Bubble sort
Quick sort Shell sort
-----------------------
------------------- -----------------------
real: 0.00
real: 59.66 real: 0.02
user: 0.00
user: 55.30 user: 0.03
sys: 0.00
sys: 1.81 sys: 0.00
Insertion sort
----------------------- HEAP sort
real: 0.00 -----------------------
user: 0.00 real: 0.01
sys: 0.00 user: 0.01
sys: 0.00
Radix Sort Disadvantages
The speed of Radix Sort largely depends on
the inner basic operations, and if the operations
are not efficient enough, Radix Sort can be slower
than some other algorithms such as Quick Sort and
Merge Sort. These operations include the insert
and delete functions of the sublists and the process
of isolating the digit you want.
+ This version of the bucket sort requires copying all the data
back to the origin
al array on each pass. Another possibility is to create a second
double-subscripted bucket
array and repeatedly swap the data between the two bucket
arrays.
Heap sort
Pros:
In-place and non-recursive, making it a good choice for
extremely large data bases.
Cons:
Slower than the merge and quick sorts.
Graphical analysis
Heap sort
Comparison of high level sorts
Stability