Problem Statement: You are given a positive integer n. Your task is to find and return its square root. If
Continue readingCategory: 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 readingSearch 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 readingFirst 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 readingFloor 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 readingSearch Insert Position
Problem Statement: You are given a sorted array arr of distinct values and a target value x. You need to
Continue readingImplement Upper Bound
Problem Statement: Given a sorted array of N integers and an integer x, write a program to find the upper
Continue readingImplement Lower Bound
Problem Statement: Given a sorted array of N integers and an integer x, write a program to find the lower
Continue readingMinimum 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 readingCount 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