Skip to content

# Tag Archives: Binary Search

Given a sorted array arr[] of size N and an integer K, the task is to find Kth smallest element present in the array. The… Read More
Given a sorted array arr[] of size N and an integer key, the task is to find the index at which key is present in… Read More
Given two integers L and R and an array arr[] consisting of N positive integers( 1-based indexing ) such that the frequency of ith element… Read More
Given an integer K and two arrays A[] and B[] consisting of N and M integers, the task is to maximize the number of elements… Read More
Given an array arr[] consisting of N pairs of type {L, R}, each representing a segment on the X-axis, the task is to find the… Read More
Given an array arr[] consisting of N positive integers representing the weights of N items and a positive integer D, the task is to find… Read More
Given a sorted array arr[] consisting of N integers, representing points on a line and an integer K, the task is to find any point… Read More
Given two arrays A[] and B[] of size N each, the task is to find the minimum possible sum of absolute difference of same indexed… Read More
Given an array arr[] consisting of N integers and an array P[] consisting of M integers such that P[i] represents the score obtained by working… Read More
Given an array arr[] consisting of N distinct integers, the task is to convert the given array into a sequence of first N non-negative integers,… Read More
Given a positive integer N, the task is to count the number of integers from the range [1, N] having exactly 5 divisors. Examples: Input:… Read More
Given an array arr[] consisting of N positive integers representing the lengths of N ropes and a positive integer K, the task is to find… Read More
Given two positive integers W and H and N rectangles of dimension W*H, the task is to find the smallest size of the square required… Read More
Given three arrays a[], b[] and c[] of sizes A, B and C respectively, the task is to find the minimum possible value of abs(a[i]… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to minimize the maximum element present in the… Read More