Showing posts with label BINARY SEARCH. Show all posts
Showing posts with label BINARY SEARCH. Show all posts

ANALYSIS DESIGN OF ALGORITHM | BINARY SEARCH

 

📌Highlights: Hi Friends ! In this post I am going to explain the concept of Binary Search , How this will work, How to write Binary Search Algorithm, How to write the procedure of Binary Search in C.How to find their complexity and example. 


Binary Search method is based on divide and conquer strategy. In Binary search first we find mid position element of array and point it to the (MID) index pointer. Now we compare searching element (S) to MID element. Such that 


If MID position element is greater than (S) then we discard second part of array and continue binary search with first part from (LOW) to (MID-1).


If MID position is less than (S) then we discard first part of array and continue Binary Search with second part from (MID+1) to (HIGH).