Computer Science, asked by shawsubham952, 5 months ago

Write a Function in Python to search a number from the entered list using binary search

technique.​

Answers

Answered by raazu12345
2

Answer:

I am really sorry bro,I don't know the answer,plzz excuse me.

Explanation:

mark me as brainly answer plzz

Answered by swatisinghsingh16050
4

Answer:

Python Program for Binary Search (Recursive and Iterative)

In a nutshell, this search algorithm takes advantage of a collection of elements that is already sorted by ignoring half of the elements after just one comparison.

Compare x with the middle element.

If x matches with the middle element, we return the mid index.

Else if x is greater than the mid element, then x can only lie in the right (greater) half subarray after the mid element. Then we apply the algorithm again for the right half.

Else if x is smaller, the target x must lie in the left (lower) half. So we apply the algorithm for the left half.

Explanation:

i hope it's help you

please mark me brainlist

Similar questions