Difference Between Quick Sort and Merge Sort PDF

Title Difference Between Quick Sort and Merge Sort
Course Btech
Institution APJ Abdul Kalam Technological University
Pages 13
File Size 632 KB
File Type PDF
Total Downloads 13
Total Views 128

Summary

Comparison in data structures about quick sort and merge sort...


Description

Difference Between Quick Sort and Merge Sort A sorting is the arrangement of collectively data in particular format like ascending or descending order. Generally, it is used to arrange the homogeneous data in sorted manner. Using the sorting algorithms, we can arrange the data in a sequence order and search an element easily and faster. Sorting techniques depends on two situation such as total time and total space required to execute a program. In this section, we will discuss quick sort and merge sort and also compare them each other.

Quick Sort Quick sort is a comparison based sorting algorithm that follows the divide and conquer technique to sort the arrays. In quick sort, we usually use a pivot (key) element to compare and interchange the position of the element based on some condition. When a pivot element gets its fixed position in the array that shows the termination of comparison & interchange procedure. After that, the array divides into the two sub arrays. Where the first partition contains all those elements that are less than pivot (key) element and the other parts contains all those elements that are greater than pivot element. After that, it again selects a pivot element on each of the sub arrays and repeats the same process until all the elements in the arrays are sorted into an array.

Algorithm of Quick Sort Partition (A, p, r) 1. X...


Similar Free PDFs