## Sort an array according to absolute difference with given value using Functors

Given an array of n distinct elements and a number x, arrange array elements according to the absolute difference with x, i. e., the element… Read More »

- Make all numbers of an array equal
- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Sum of XOR of all subarrays
- Find k closest numbers in an unsorted array
- Count pairs in array whose sum is divisible by K
- Building Heap from Array
- Amazon Internship Interview Experience
- Program for K Most Recently Used (MRU) Apps
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Longest subsequence such that adjacent elements have at least one common digit
- k-th missing element in an unsorted array
- Minimum operations required to make all the array elements equal
- Count of pairs (x, y) in an array such that x < y
- Maximum sum such that no two elements are adjacent | Set 2
- Number of unique pairs in an array
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Merge K sorted arrays of different sizes | ( Divide and Conquer Approach )
- Maximum element in a sorted and rotated array
- Length of the longest alternating subarray
- Minimum elements to be removed such that sum of adjacent elements is always even
- Given two arrays count all pairs whose sum is an odd number
- Array Manipulation and Sum
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Sort an array without changing position of negative numbers
- Count array elements that divide the sum of all other elements
- Create linked list from a given array
- Find minimum difference between any two elements | Set 2
- Find two numbers whose divisors are given in a random order
- Maximum absolute difference in an array

Given an array of n distinct elements and a number x, arrange array elements according to the absolute difference with x, i. e., the element… Read More »

Given two integers L and R, the task is to find the XOR of elements of the range [L, R]. Examples :‘ Input: L =… Read More »

Given an array of integers, Task is to print the Maximum Product among the array such that its previous and next element product is maximum.… Read More »

Given an array of size N and an integer K. The array consists of only digits {0, 1, 2, 3, …k-1}. The task is to… Read More »

Given an array arr[] and three integers D, A and B. You start with the number D and at any time you can add or… Read More »

Given an Array[] of N elements and a number K. ( 1 <= K <= N ) . Split the given array into K sub… Read More »

Given an array arr[] of N integers, the task is to find the minimum deletions required such that frequency of arr[i] is exactly arr[i] in… Read More »

Given an array arr[] of size N and an integer K, the task is to find the Kth smallest element from the array in constant… Read More »

Given an array of integers of size N, The task is to print the consecutive integers as a range. Examples: Input : N = 7,… Read More »

Given an array arr[] of N elements, you have to perform the following operation on the given array until the array is reduced to a… Read More »

Given an array of size N. The task to find the maximum possible number of elements divisible by 3 that are in the array after… Read More »

Given two arrays a[] and b[], the task is to find the count of common elements in both the given arrays. Note that both the… Read More »

Given an array arr[] of N elements and an integer K, the task is to generate an B[] with the following rules: Copy elements arr[1…N],… Read More »

Given an array arr[] of N elements, the task is to check whether the array have all same (identical) elements or not without using the… Read More »

Given an array arr[] and an integer K, the task is to count the pairs whose sum of set bits is K Examples: Input: arr[]… Read More »