sorting technique analysis based on following
1) number of comparisons ( it will decide time complexity of
sorting technique)
2) number of swaps ( for arranging order either increasing or
decreasing)
3) adaptive (if they already in the sorted order either
increasing or decreasing
so sorting method must take minimum time "any sorting
method takes less
critera for analysis time over already sorted list then we can called as
adaptive")
1) bubble :- ---- 1,2 & 3 take O(n^2) time
4)
2) stable ( if a sorting
insertion | 4,5,6technique
& 7 take isO(npreserving
log n) timethe order of
duplicate elements
3) selection. in the sorted list then that
| 8 will takes O(n ^ 3/2) time algorithm
called
4) heapstable
sort ) |
extra memory
5) merge sort |(------
somecomparison
sorting techniques
based sortsrequired extra
memory
6) quick for
sortsorting| elemnts)
7) tree sort |
type of sorting techniques 8) shell sort -----
9) count sort ---- 9,10 & 11 take O(n) time but takes lots of space
10) bucket / bin sort | ------ index based sorts
it11)
will compare
radix sort consecutive
---- pair of elements every time,
Bubble sort
[ in array : traverse from last element
in linked list : traverse from first element ] only insertion of
a element for sorted array or list.
- initially we should assume the first elemt of list is sorted
insertion sort
Bubble sort v/s insertion sort
selection sort
Quick sort
merge sort