## Minimum increment or decrement operations required to make the array sorted

Given an array arr[] of N integers, the task is to sort the array in non-decreasing order by performing the minimum number of operations. In… Read More »

- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Optimal Strategy for a Game | Set 2
- Find k closest numbers in an unsorted array
- Create linked list from a given array
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Maximum Sum Subsequence of length k
- Maximum sum such that no two elements are adjacent | Set 2
- Sort an array without changing position of negative numbers
- Kth smallest element in a subarray
- Introduction to Data Structures | 10 most commonly used Data Structures
- Given two arrays count all pairs whose sum is an odd number
- Count the triplets such that A[i] < B[j] < C[k]
- Find maximum xor of k elements in an array
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Number of subsets with zero sum
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- Maximum sum combination from two arrays
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Remove duplicates from unsorted array using Set data structure
- Pair with largest sum which is less than K in the array
- Maximum water that can be stored between two buildings
- Iterative approach to print all permutations of an Array
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Maximize the happiness of the groups on the Trip

Given an array arr[] of N integers, the task is to sort the array in non-decreasing order by performing the minimum number of operations. In… Read More »

Given an array A[] of N integers, the task is to generate an array B[] such that B[i] contains the count of indices j in… Read More »

Given an array arr[]. The task is t find the value of X such that the result of the expression (A[1] – X)^2 + (A[2]… Read More »

Given a list of integers from the range [1, N] with some of the elements missing. The task is to find the missing elements. Note… Read More »

Given a binary pattern patt and Q queries where each query consists of a range [L, R], for every query the task is to find… Read More »

Given an array of size N. The task is to find the product of values of all possible non-empty subsets of the given array. Examples:… Read More »

Given task is to implement a class in C++ which behaves just like the Vector class. Vectors are same as dynamic arrays with the ability… Read More »

Given an array of non-negative integers arr[], the task is to find a pair (n, r) such that nPr is maximum possible and r ≤… Read More »

Given an array arr[] of N integers, the task is to find the sum of values of all possible non-empty subsets of array the given… Read More »

Given an array of non-negative integers arr[]. The task is to find a pair (n, r) such that value of nCr is maximum possible r… Read More »

Given N lecture timings, with their start time and end time (both inclusive), the task is to find the minimum number of halls required to… Read More »

Write a program in C++ to print an Array using Recursion Using static variable: Static variables have a property of preserving their value even after… Read More »

Given an array arr[], the task is to finds the total significant inversion count for the array. Two elements arr[i] and arr[j] form a significant… Read More »

Given an array arr[], the task is to answer queries to find the maximum of all the elements in the index range arr[L…R]. Examples: Input:… Read More »

Given a binary array of 0’s and 1’s, the task is to find the number of ways to erase exactly one element from this array… Read More »