Web Analytics
API developement platform

Binary Search

A divide and conquer method


Try Live Demo

Binary Search is defined as a searching algorithm used in a sorted array by repeatedly dividing the search interval in half. The idea of binary search is to use the information that the array is sorted and reduce the time complexity to O (log N). The data structure must be sorted to implement the algorithm, and access to any data structure element should take a constant time.

Input Parameters:
Name Type Description
arr Integer Array Array of integer sorted elements
target Integer Target element to be searched
Output Parameters:
Name Type Description
strOutput String Prints the element and its position

Download the SDK

API developement services

Setup Syncloop Embedded in your application

Syncloop provides all libraries & dependencies to integration syncloop embedded in your existing application.

Setup SDK