COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Bubble sort
|
|
Merge sort
|
|
Binary search
|
|
Linear search
|
Detailed explanation-1: -Binary search works on sorted arrays. Binary search begins by comparing an element in the middle of the array with the target value. If the target value matches the element, its position in the array is returned.
Detailed explanation-2: -bartleby. EngineeringComputer ScienceWhich of the following is a required condition for binary search algorithms? A The list must be sorted.
Detailed explanation-3: -Binary search works by assuming the middle of the array contains the median value in the array. If it is not sorted, this assumption does not make sense, since the median can be anywhere and cutting the array in half could mean that you cut off the number you were searching for.
Detailed explanation-4: -So, the answer is NO, it is not possible to use or implement Binary Search on unsorted arrays or lists, because, the repeated targeting of the mid element of one half depends on the sorted order of data structure.