Review Note

Last Update: 03/13/2024 10:56 AM

Current Deck: IIIT Nagpur::2nd Semester::5. Data Structures::L-05 Searching Techniques

Published

Currently Published Content


Front
Q. What do you mean by Binary Search? Write it's characteristics.
Q. Also write the steps in order to implement Binary Search in a Program with Example.
Back
Cont…
• Binary search
   • Search technique - works efficiently on sorted lists
       • ensure that the list is sorted
• Binary search follows the divide and conquer approach
   • List is divided into two halves, and the item is compared
      with the middle element of the list
       • If the match is found then, the location of the middle
          element is returned
       • Otherwise, searching is done into either of the halves
          depending upon the result produced through the
          match
Cont…
Cont…
• Example



  Search K = 56
  mid = (beg + end)/2

No published tags.

Pending Suggestions


No pending suggestions for this note.