Computer Science, asked by krirarthkaushik2333, 10 months ago

In a binary search algorithm, if the element to be searched is greater than the pivot value (middle value), then ______________ is split in half.

Answers

Answered by TeacherChebet
4

Answer:

pick the elements to the right.

Explanation:

1.If the element is greater than the pivot value, then pick the elements to the right of the middle value, and start with middle value.

2.If the target value is less than the number in the middle value, then pick the elements to the left of the middle value, and start with middle value

3.When a match is found, return the index of the element matched.

4.If no match is found, then return -1

Answered by AadilPradhan
2

Answer:

then right half subarray is split in half.

Explanation:

In binary search, first of all, the array is sorted and middle value is found. The element to be searched (say x) is compared with the middle element:-

- If x is less than pivot (middle) value then left subarray is split in half

- If x is greater than middle value then right subarray is split in half

- If x is equal to the middle value, it means element is found.

The above three steps are repeated until the element is found.

Similar questions