62.3k views
23 votes
What are the four steps of the binary search algorithm

User Jeto
by
6.4k points

2 Answers

14 votes

Answer:

Step 1 - Read the search element from the user.

Step 2 - Find the middle element in the sorted list.

Step 3 - Compare the search element with the middle element in the sorted list.

Step 4 - If both are matched, then display "Given element is found!!!" and terminate the function.

User Igor Rjabinin
by
6.6k points
14 votes

Answer:

These are the main steps are given the photo below

I hope my answer helps you.

What are the four steps of the binary search algorithm-example-1
User Rishabh Ohri
by
7.1k points