Sorting on multiple keys
Sorting on multiple keys The sorting algorithm may be applied on multiple keys such that if first field contains duplicate values, then sorting is done… Read More »Sorting on multiple keys
Sorting on multiple keys The sorting algorithm may be applied on multiple keys such that if first field contains duplicate values, then sorting is done… Read More »Sorting on multiple keys
Sorting – Address Calculation Sort (Hashing) In this method a function f is applied to each key. The result of this function determines into which… Read More »Sorting – Address Calculation Sort (Hashing)
Sorting – Quick Sort (Partition Exchange Sort) Suppose x be an array, n is the number of elements. Choose an element from a specific position… Read More »Sorting – Quick Sort (Partition Exchange Sort)
Sorting – Merge Sort Merging:- Merging is the process of combining two or more sorted files into a third sorted file. An example of a… Read More »Sorting – Merge Sort
Sorting – Radix Sort Radix Sort sorts the number in scans equal to the number of digits of maximum number. eg. 45, 3, 235, 89,… Read More »Sorting – Radix Sort
Sorting – Straight Selection Sort Begin from the first element, taking i=0 to n-1. Find the minimum number in the first scan. Interchange ith element… Read More »Sorting – Straight Selection Sort
Sorting – General Selection Sort Steps: Fetch the numbers to be sorted in an array. Push these numbers one by one to a priority queue. … Read More »Sorting – General Selection Sort
Insertion Sort Sorts a set of records by comparing the next record with all the previous elements. Compare next element with previous. If next element… Read More »Sorting – Insertion sort
Bubble sort: Two consecutive elements are compared. It sorts the elements in right to left fashion. Thus, (n-i) comparisons are made. Example: Frequency: i j … Read More »Sorting – Bubble sort
Shell Sort: Shell sort is quite similar to that of insertion sort with the only difference that in shell sort, higher values of k are… Read More »Sorting – Shell sort