Problem Statement: You are given a positive integer n. Your task is to find and return its square root. If

Continue reading# Category: Binary search

## Find out how many times the array has been rotated

Problem Statement: Given an integer array arr of size N, sorted in ascending order (with distinct values). Now the array

Continue reading## Search Element in Rotated Sorted Array II

Problem Statement: Given an integer array arr of size N, sorted in ascending order (may contain duplicate values) and a

Continue reading## First and Last Occurrences in Array

Problem Statement: Given a sorted array arr of n integers and a target value k. Write a program to find

Continue reading## Floor and Ceil in Sorted Array

Problem Statement: You’re given an sorted array arr of n integers and an integer x. Find the floor and ceiling

Continue reading## Search Insert Position

Problem Statement: You are given a sorted array arr of distinct values and a target value x. You need to

Continue reading## Implement Upper Bound

Problem Statement: Given a sorted array of N integers and an integer x, write a program to find the upper

Continue reading## Implement Lower Bound

Problem Statement: Given a sorted array of N integers and an integer x, write a program to find the lower

Continue reading## Minimum in Rotated Sorted Array

Problem Statement: Given an integer array arr of size N, sorted in ascending order (with distinct values). Now the array

Continue reading## Count 1’s in Sorted binary Array

Problem Statement: Given a sorted binary array (consisting of only 0’s and 1’s), the task is to find the total

Continue reading