Sort an Increasing-Decreasing Array
Given a K-increasing-decreasing array arr[], the task is to sort the given array. An array is said to be K-increasing-decreasing if elements repeatedly increase upto… Read More »
Given a K-increasing-decreasing array arr[], the task is to sort the given array. An array is said to be K-increasing-decreasing if elements repeatedly increase upto… Read More »
Given an array arr[] of size N which represents the initial number on each card and given a two dimensional array B[][] of size M… Read More »
Given four arrays containing integer elements and an integer sum, the task is to count the quadruplets such that each element is chosen from a… Read More »
Given a level-order sorted complete binary tree, the task is to check whether a key exists in it or not. A complete binary tree has… Read More »
Given an array arr[] of N elements and a positive integer K such that K ≤ N. The task is to find the number of… Read More »
Given an array of infinite length and two integers M and N which are co-primes, the task is to find the number of positions that… Read More »
Given a matrix, the task is to convert the given Matrix into sorted Spiral Matrix. Examples: Input: y[][] = { { 2, 5, 12 },… Read More »
Given an array arr[] of N integers, the task is to find the maximum mod value for any pair (arr[i], arr[j]) from the array. Examples:… Read More »
Given an array arr[] of N integers and two players A and B are playing a game where the players pick the element with the… Read More »
Given two string S1 and S2, the task is to check whether both the strings can be made equal by performing the given operation on… Read More »
Given a stack of integers and an integer K, the task is to sort the elements of the given stack using another stack in the… Read More »
Given an array arr[] of length N, the task is to find the length of the largest sub-sequence with non-negative sum. Examples: Input: arr[] =… Read More »
Given N ranges [L, R] with velocities vel[]. The task is to assign each range a direction i.e. either left or right. All the ranges… Read More »
Consider n points on the Cartesian Coordinate Plane. Let point (Xi, Yi) is given a value Vi. A line parallel to y-axis is said to… Read More »
Given an array of red, blue and yellow objects, the task is to use an in-place sorting algorithm to sort the array in such a… Read More »