Title | 21MCA2137Merge Sort DAA practical worksheet |
---|---|
Author | Anonymous User |
Course | Master of computer applications |
Institution | Chandigarh University |
Pages | 7 |
File Size | 425.8 KB |
File Type | |
Total Downloads | 92 |
Total Views | 142 |
analyse the searching and find the merge sort in searching with algorithm and programs...............
Experiment Title. Student Name: Shweta Sharma UID: 21MCA2137 Branch: MCA Section/Group: MCA-B Date of Performance: o6/09/2021 Subject code: 21CAP-606
1. Aim/overview of the practical: To perform Merge sort 2. Task to be done: Write a program to count & display number of exchanges while implementation 3. Algorithm/Flowchart : merge sort for worst case, average case and best case Merge sort(arr[],l,r) If r>1 1. Start 2. Find the middle point to divide the array into two halves: 3. Call mergeSort for first half: Call mergeSort (arr,1,m) 4. Call mergeSort second half: Call mergeSort(arr,m+1,r 5. Merge the two halves sorted in step 2 and 3: Call merge(arr,l,m,r) 6. Exit
4 Dataset: 25
65
8
5 Code for experiment/practical: #include using namespace std;
void Merge(int *a, int low, int high, int mid) { int i, j, k, temp[high-low+1]; i = low; k = 0; j = mid + 1;
while (i...