Question 1- Describe the following: Well known Sorting Algorithms Divide and Conquer Techniques
Answer:
Well known Sorting Algorithms
We know the following well - known algorithms for sorting a given list of numbers:
Ordered set: Any set S with a relation, say, ≤ , is said to be ordered if for any two elements x and y of S, either x ≤ y or x ≥ y is true. Then, we may also say that (S, ≤) is an ordered set.
1. Insertion sort
The insertion sort, algorithm for sorting a list L of n numbers represented by an array A [ 1… n] proceeds by picking up the numbers in the array from left one by one and each newly picked up number is placed at its relative position, w.r.t. the sorting order, among the earlier ordered ones. The process is repeated till each element of the list is placed at its correct relative position.
2. Bubble sort
The Bubble Sort algorithm for sorting of n numbers, represented by an array A [1..n], proceeds by scanning the array from left to right. At each stage, compares adjacent pairs of numbers at positions A[i] and
A [i +1] and whenever a pair of adjacent numbers is found to be out of order, then the positions of the numbers are exchanged. The algorithm repeats the process for numbers at positions A [i+1] and A [i + 2]
3. Selection sort
Selection Sort for sorting a list L of n numbers, represented by an array
A [ 1.. n], proceeds by finding the maximum element of the array and placing it in the last position of the array representing the list. Then repeat the process on the sub array representing the sublist obtained from the list excluding the current maximum element.
4. Shell sort
The sorting algorithm is named so in honor of D.L Short (1959), who suggested the algorithm. Shell sort is also called diminishing -increment sort. The essential idea behind Shell Sort is to apply any of the other sorting algorithms (generally Insertion Sort) to each of the several interleaving sublists of