62,788 views
40 votes
40 votes
What are the four steps of the binary search algorithm

User Meme Overlord
by
2.4k points

2 Answers

27 votes
27 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 Valli
by
3.0k points
10 votes
10 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 Dusan Plavak
by
2.7k points