# Category Archives: Divide and Conquer

## Change in Median of given array after deleting given elements

Given two arrays arr1[] and arr2[]. The array arr1[] is sorted. The task is to print the change in median after removing each element from… Read More »

## How to implement text Auto-complete feature using Ternary Search Tree

Given a set of strings S and a string patt the task is to autocomplete the string patt to strings from S that have patt… Read More »

## Fast Doubling method to find the Nth Fibonacci number

Given an integer N, the task is to find the N-th Fibonacci numbers. Examples: Input: N = 3 Output: 2 Explanation: F(1) = 1, F(2)… Read More »

## Longest subarray having sum K | Set 2

Given an array arr[] of size N containing integers. The task is to find the length of the longest sub-array having sum equal to the… Read More »

## Largest substring where all characters appear at least K times | Set 2

Given a string str and an integer K, the task is to find the length of the longest sub-string S such that every character in… Read More »

## Split a given array into K subarrays minimizing the difference between their maximum and minimum

Given a sorted array arr[] of N integers and an integer K, the task is to split the array into K subarrays such that the… Read More »

## Sum of all array elements less than X and greater than Y for Q queries

Given a sorted array arr[], and a set Q having M queries, where each query has values X and Y, the task is to find… Read More »

## Reduce the array by deleting elements which are greater than all elements to its left

Given an array arr[] of N integers, the task is to delete the element from the given array if element to it’s left is smaller… Read More »

## Check if a string is a scrambled form of another string

Given two strings S1 and S2 of equal length, the task is to determine if S2 is a scrambled form of S1. Scrambled string: Given… Read More »

## Minimum value of K such that sum of cubes of first K natural number is greater than equal to N

Given a number N, the task is to find the minimum value K such that the sum of cubes of the first K natural number… Read More »

## Number Guessing Game in Python using Binary Search

In the number guessing game, the user selects a number within a defined range and then the program guesses the number. If the number guessed… Read More »

## Check if a given number is a Perfect square using Binary Search

Check if a given number N is a perfect square or not. If yes then return the number of which it is a perfect square,… Read More »

## Range Queries for number of Armstrong numbers in an array with updates

Given an array arr[] of N integers, the task is to perform the following two queries: query(start, end): Print the number of Armstrong numbers in… Read More »

## Array Range Queries to find the Maximum Armstrong number with updates

Given an array arr[] of N integers, the task is to perform the following two queries:  maximum(start, end): Print the maximum Armstrong number of elements… Read More »

## Array range queries to find the number of perfect square elements with updates

Given an array arr[] of N integers, the task is to perform the following two queries:  query(start, end): Print the number of perfect square numbers… Read More »