Group Member:
Sheher Bano
Naseema Khatoon
Binary Search
Introduction:
Binary search is a search algorithm that find the
position of a target value with in a sorted array.
In binary search the data is particular order before
searching.
Binary search is also known as half interval search(because
of its fundamental operation of repeatedly dividing the search interval in half until it
finds the target ).
Binary search algorithm works on the principle of divide
and conquer.
Binary search can be implemented only sorted list of
element.
Algorithm:
BinarySearch(int a[] ,int key ,int low ,int high)
Mid=low + high /2
 If (key ==A[mid])
Return mid
Else if (key<A[mid])
Set max= mid-1
Else
Set min= mid+1
return
Time Complexity:
The running time complexity for binary search are of
three types
Worst Case, time complexity: 0(log n)
Average Case, time complexity: 0(log n)
Best Case, time complexity: 0(1)
Application:
The binary search is an efficient searching method
and used to search desired record from database.
Binary Search can be used to search for a file or
directory in a hierarchical structure.
Binary Search helps users locate books or
resources efficiently based on various criteria such
as author, title, or subject.
Advantages:
It is better than a linear search algorithm since its run
time complexity is 0(log N)
At each iteration, the binary search algorithm
eliminates half of the least and significantly reduce
the search space.
The binary search algorithm works even when the
array is rotate by some position and finds the target
element.
Disadvantage:
This algorithm requires the list is to be sorted the
only this method is applicable.
Complexity for Non-Numeric Data.
Inefficient for insertion and deletion.
The recursive method is used stack space.
Difficulty with Linked Lists.
Conclusion:
In conclusion, the Binary Search algorithm is a
fundamental and efficient technique for searching for a
specific element in a sorted array or list
Binary search is a search algorithm that allow us to find
element in a sorted list
Binary search is efficient because it continuously divides
the search space in half, until it find the element or only
one element remains in the list two be tested.
Binary Search.pptx

Binary Search.pptx

  • 1.
    Group Member: Sheher Bano NaseemaKhatoon Binary Search
  • 2.
    Introduction: Binary search isa search algorithm that find the position of a target value with in a sorted array. In binary search the data is particular order before searching. Binary search is also known as half interval search(because of its fundamental operation of repeatedly dividing the search interval in half until it finds the target ). Binary search algorithm works on the principle of divide and conquer. Binary search can be implemented only sorted list of element.
  • 3.
    Algorithm: BinarySearch(int a[] ,intkey ,int low ,int high) Mid=low + high /2  If (key ==A[mid]) Return mid Else if (key<A[mid]) Set max= mid-1 Else Set min= mid+1 return
  • 4.
    Time Complexity: The runningtime complexity for binary search are of three types Worst Case, time complexity: 0(log n) Average Case, time complexity: 0(log n) Best Case, time complexity: 0(1)
  • 5.
    Application: The binary searchis an efficient searching method and used to search desired record from database. Binary Search can be used to search for a file or directory in a hierarchical structure. Binary Search helps users locate books or resources efficiently based on various criteria such as author, title, or subject.
  • 6.
    Advantages: It is betterthan a linear search algorithm since its run time complexity is 0(log N) At each iteration, the binary search algorithm eliminates half of the least and significantly reduce the search space. The binary search algorithm works even when the array is rotate by some position and finds the target element.
  • 7.
    Disadvantage: This algorithm requiresthe list is to be sorted the only this method is applicable. Complexity for Non-Numeric Data. Inefficient for insertion and deletion. The recursive method is used stack space. Difficulty with Linked Lists.
  • 8.
    Conclusion: In conclusion, theBinary Search algorithm is a fundamental and efficient technique for searching for a specific element in a sorted array or list Binary search is a search algorithm that allow us to find element in a sorted list Binary search is efficient because it continuously divides the search space in half, until it find the element or only one element remains in the list two be tested.