## Search an element in a sorted and rotated array with duplicates

Given an array arr[] which is sorted and rotated, the task is to find an element in the rotated array (with duplicates) in O(log n)… Read More »

## Arrange numbers to form a valid sequence

Given an array arr[] with N distinct numbers and another array arr1[] with N-1 operators (either < or >), the task is to organize the… Read More »

## C program for Time Complexity plot of Bubble, Insertion and Selection Sort using Gnuplot

Prerequisite:Comparison among bubble sort, insertion sort and selection sort. Write a C program to plot and analyze the time complexity of Bubble sort, Insertion sort… Read More »

## Sorting Algorithm Visualization : Merge Sort

The human brain can easily process visuals instead of long codes to understand the algorithms. In this article, a program that program visualizes the Merge… Read More »

## Median of sliding window in an array

Given an array of integer arr[] and an integer k, the task is to find the median of each window of size k starting from… Read More »

## Find the distance between two person after reconstruction of queue

Given a 2D array of size N containing distinct height of people standing in a queue, and a number corresponding to each person (P) that… Read More »

## Find the minimum cost to cross the River

Given an integer N which is the number of villagers who need to cross a river but there is only one boat on which a… Read More »

## Minimize the sum of differences of consecutive elements after removing exactly K elements

Given a sorted array of length ‘N’ and an integer ‘K'(K<N), the task is to remove exactly 'K' elements from the array such that sum… Read More »

## Check if N rectangles of equal area can be formed from (4 * N) integers

Given an integer N and an array arr[] of size 4 * N, the task is to check whether N rectangles of equal area can… Read More »

## Minimum elements to be removed from the ends to make the array sorted

Given an array arr[] of length N, the task is to remove the minimum number of elements from the ends of the array to make… Read More »

## Value to be subtracted from array elements to make sum of all elements equals K

Given an integer K and an array height[] where height[i] denotes the height of the ith tree in a forest. The task is to make… Read More »

## How to sort an array in a single loop?

Given an array of size N, the task is to sort this array using a single loop. How the array is sorted usually? There are… Read More »

## Check if a symmetric plus is possible from the elements of the given array

Given an array arr[] of N elements, the task is to check whether a symmetric plus is possible with the elements of the given array.… Read More »

## 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 »

## Maximum possible sum after M operations on N cards

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 »