Techno Blender
Digitally Yours.

What is Binary Search Algorithm?

0 48


Improve Article

Save Article

Like Article

Improve Article

Save Article

Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half and the correct interval to find is decided based on the searched value and the mid value of the interval.

Example of binary search

Properties of Binary Search:

  • Binary search is performed on the sorted data structure for example sorted array. 
  • Searching is done by dividing the array into two halves. 
  • It utilizes the divide-and-conquer approach to find an element.

Pre-requisites to apply Binary Search Algorithm:

For applying binary search in any data structure, the data structure must satisfy the following two conditions:

  • The data structure is sorted.
  • Any random element of the data structure can be directly accessed i.e., can be accessed in constant time.

Applications of Binary Search:

  • The binary search operation is applied to any sorted array for finding any element. 
  • Binary search is more efficient and faster than linear search. 
  • In real life, binary search can be applied in the dictionary.
  • Binary search is also used to debug a linear piece of code.
  • Binary search is also used to find if a number is a square of another or not.

What else can you read?


Improve Article

Save Article

Like Article

Improve Article

Save Article

Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half and the correct interval to find is decided based on the searched value and the mid value of the interval.

Example of binary search

Example of binary search

Properties of Binary Search:

  • Binary search is performed on the sorted data structure for example sorted array. 
  • Searching is done by dividing the array into two halves. 
  • It utilizes the divide-and-conquer approach to find an element.

Pre-requisites to apply Binary Search Algorithm:

For applying binary search in any data structure, the data structure must satisfy the following two conditions:

  • The data structure is sorted.
  • Any random element of the data structure can be directly accessed i.e., can be accessed in constant time.

Applications of Binary Search:

  • The binary search operation is applied to any sorted array for finding any element. 
  • Binary search is more efficient and faster than linear search. 
  • In real life, binary search can be applied in the dictionary.
  • Binary search is also used to debug a linear piece of code.
  • Binary search is also used to find if a number is a square of another or not.

What else can you read?

FOLLOW US ON GOOGLE NEWS

Read original article here

Denial of responsibility! Techno Blender is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – [email protected]. The content will be deleted within 24 hours.
Leave a comment