Skip to content

Category Archives: Divide and Conquer

Given N vertex where N is even. Initially there is no edge between any of the vertices. You are allowed to perform operation as illustrated here:  … Read More
Given a number X, the task is to find the minimum number N such that the total set bits of all numbers from 1 to… Read More
Given a string S containing lowercase latin letters. A character c is called K-amazing if every substring of S with length atleast K contains this… Read More
Given an array of N integers where array elements form a strictly decreasing and increasing sequence. The task is to find the smallest number in… Read More
Given an array arr[] of N integers and number of queries Q. The task is to answer three types of queries. Update [l, r] –… Read More
Given an integer k and a monotonic increasing sequence: f(n) = an + bn [log2(n)] + cn^3 where (a = 1, 2, 3, …), (b =… Read More
Given an array of n integers. The task is to find the largest number which is a perfect square. Print -1 if there is no… Read More
Given an integer ‘K’ and a row-wise sorted 2-D Matrix i.e. the matrix has the following properties:   Integers in each row are sorted from left… Read More
Given an array ‘arr’, the task is to find all possible integers each of which is the bitwise AND of at least one non-empty sub-array… Read More
Pre-requisites: Segment Tree Given an array of digits arr[]. Given a number of range [L, R] and a digit X with each range. The task… Read More
Given an sorted array of positive numbers our tasks is to find the kth smallest sum of continuous subarray. Examples: Input : a[] = {1,… Read More
Binary Search is a searching technique which works on the Divide and Conquer approach. It is used to search for any element in a sorted… Read More
We are given a recursive function that describes Nth terms in the form of other terms. In this article, we have taken specific examples. Now you… Read More
Binary Search is a technique used to search element in a sorted list. In this article, we will looking at library functions to do Binary… Read More
Prerequisite :Merge Sort and Quick Sort Quick sort is an internal algorithm which is based on divide and conquer strategy. In this: The array of… Read More

Start Your Coding Journey Now!