COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Bubble sort
|
|
Merge sort
|
|
Linear search
|
|
Binary search
|
Detailed explanation-1: -Merge sort is a recursive algorithm that continually splits a list in half. If the list is empty or has one item, it is sorted by definition (the base case). If the list has more than one item, we split the list and recursively invoke a merge sort on both halves.
Detailed explanation-2: -The Merge Sort algorithm is divided into two parts. The first part repeatedly splits the input list into smaller lists to eventually produce single-element lists.
Detailed explanation-3: -Merge sort involves recursively splitting the array into 2 parts, sorting and finally merging them. A variant of merge sort is called 3-way merge sort where instead of splitting the array into 2 parts we split it into 3 parts. Merge sort recursively breaks down the arrays to subarrays of size half.
Detailed explanation-4: -Selection Sort This algorithm gets its name from the way it iterates through the array: it selects the current smallest element, and swaps it into place.
Detailed explanation-5: -The selection sort improves on the bubble sort by making only one exchange for every pass through the list.