Skip to content

Category Archives: Divide and Conquer

Given an array arr[]. The task is to divide arr[] into the maximum number of partitions, such that, those partitions if sorted individually make the… Read More
Given a linked list lis of length N, where N is even. The task is to maximize the sum of two equidistant nodes from the… Read More
Given an array arr[], and an integer N. The task is to maximize the sum of minimum and maximum of each group in a distribution… Read More
Given an ascending sorted array arr[] of size N and an integer K, the task is to partition the given array into K non-empty subarrays… Read More
Given an array queries[][] of Q range queries, the task is to find the minimum removals from the range[l, r] such that the bitwise AND… Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers. … Read More
Given an array, arr[] of length N, and an integer K. The value of the i-th element is arr[i]. The task is to find the… Read More
Given a number ‘n’ and our goal is to find out it is palindrome or not without using any extra space. We can’t make a new… Read More
Given an array of integers arr[] of size N, the task is to check whether arr[] can be split into different subarrays such that on… Read More
Given a binary string S of length N. The task is to find the following: The minimum number of subsequences, string S can be divided… Read More
Question: Write a function to find if a given integer x appears more than n/2 times in a sorted array of n integers. Basically, we need… Read More

Start Your Coding Journey Now!