## Binary Search algorithm Implementation in Java

In this article we will see how to find an element in a sorted array using binary search algorithm, this is an in place algorithm with O(1) space complexity and O(log n) worst case time complexity.

- Home
- DS & Algorithms
- DS & Algorithms

In this section we will get in depth knowledge of Searching Algorithms, including Searching Algorithms interview questions with solution and Searching Algorithms based logical problems.

We will also look into time and space complexity of different algorithms and problems based on Searching.

These Searching Algorithms based questions with complete explanation and implementation in Java are very helpful in cracking any software engineering interview.

In this article we will see how to find an element in a sorted array using binary search algorithm, this is an in place algorithm with O(1) space complexity and O(log n) worst case time complexity.

In this article we will see how to search an element in an sorted and rotated array, lets assume we have an input array like:

Input: int[] arr = { 4, 5, 6, 7, 1, 2, 3};