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

Continue reading# Tag: Binary Search

## 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## Binary Search: Explained

This is the very first article of the Binary Search series. Until now, we have learned the linear search algorithm.

Continue reading## Binary Search With C++ STL

Problem Statement: Given a sorted array of size N, search for a given element in the array. Examples: Example 1:

Continue reading## Allocate Minimum Number of Pages

Problem Statement: Given an array ‘arr of integer numbers, ‘ar[i]’ represents the number of pages in the ‘i-th’ book. There

Continue reading## Nth Root of a Number using Binary Search

Problem Statement: Given two numbers N and M, find the Nth root of M. The nth root of a number

Continue reading## Search Element in a Rotated Sorted Array

Problem Statement: Given an integer array arr of size N, sorted in ascending order (with distinct values) and a target

Continue reading## Search Single Element in a sorted array

Problem Statement: Given an array of N integers. Every number in the array except one appears twice. Find the single

Continue reading## 4 Sum | Find Quads that add up to a target value

Problem Statement: Given an array of N integers, your task is to find unique quads that add up to give

Continue reading## Search in a sorted 2D matrix

Problem Statement: You have been given a 2-D array ‘mat’ of size ‘N x M’ where ‘N’ and ‘M’ denote

Continue reading