Problem Statement: Given an integer array arr of size N, sorted in ascending order (may contain duplicate values) and a
Continue readingTag: 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 readingBinary Search: Explained
This is the very first article of the Binary Search series. Until now, we have learned the linear search algorithm.
Continue readingBinary 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 readingAllocate 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 readingNth 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 readingSearch 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 readingSearch 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 reading4 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 readingSearch 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