## Longest subsequence having greater corner values

Given an array arr[] containing a random permutation of first N natural numbers, the task is to find the longest sub-sequence having the property that… Read More »

## Minimum moves required to change position with the given operation

Given two integers S and T and an array arr that contains elements from 1 to N in unsorted fashion. The task is to find… Read More »

## Generate a sequence with the given operations

Given a string which contains only (increase) and (decrease). The task is to return any permutation of integers [0, 1, …, N] where N ≤… Read More »

## kth smallest/largest in a small range unsorted array

Find kth smallest or largest element in an unsorted array, where k<=size of array. It is given that elements of array are in small range.… Read More »

## Maximum number of fixed points using atmost 1 swap

Given a permutation of N elements (Elements are in range 0 to N-1). A fixed point is an index at which the value is same… Read More »

## Queries for number of elements on right and left

Given Q queries of three types where every query consists of a number. Add element num on the left Add element num on the right… Read More »

## Quotient – Remainder Sort

Quotient – Remainder Sort is a non-comparison based sorting algorithm. Steps to perform Quotient – Remainder sort as described below : Find MIN and MAX… Read More »

## Kth Smallest sum of continuous subarrays of positive numbers

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 »

## Minimum array element changes to make its elements 1 to N

Suppose you are given an array with N elements with any integer values. You need to find minimum number of elements of the array which… Read More »

## Find the Missing Number in a sorted array

Given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in list. One of… Read More »

## Longest chain of arr[i], arr[arr[i]], .. without repetition

Given an array of size n such that elements in array are distinct and in range from 0 to n-1. We need to find out… Read More »

## Minimum number of adjacent swaps for arranging similar elements together

Given an array of 2 * N positive integers where each array element lies between 1 to N and appears exactly twice in the array.… Read More »

## Duplicates in an array in O(n) time and by using O(1) extra space | Set-3

Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times. Find these… Read More »

## Sorting array with conditional swapping

Given an array arr containing elements from [1…to n]. Each element appears exactly once in the array arr. Given an string str of length n-1.… Read More »

## Sort an array which contain 1 to n values

You have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace… Read More »