## Find a sorted subsequence of size 3 in linear time

Given an array of n integers, find the 3 elements such that a[i] < a[j] < a[k] and i < j < k in 0(n)… Read More »

- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Count pairs in array whose sum is divisible by K
- Find k closest numbers in an unsorted array
- Building Heap from Array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Maximum sum such that no two elements are adjacent | Set 2
- Longest subsequence such that adjacent elements have at least one common digit
- k-th missing element in an unsorted array
- Sort an array without changing position of negative numbers
- Create linked list from a given array
- Maximum element in a sorted and rotated array
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Find the longest string that can be made up of other strings from the array
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Maximum absolute difference in an array
- Find minimum difference between any two elements | Set 2
- Program to check if an Array is Palindrome or not
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Minimum elements to be removed such that sum of adjacent elements is always even
- Introduction to Data Structures | 10 most commonly used Data Structures
- Number of subarrays such that XOR of one half is equal to the other
- Maximum sum combination from two arrays
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Find m-th smallest value in k sorted arrays
- Minimum cost to reach end of array array when a maximum jump of K index is allowed

Given an array of n integers, find the 3 elements such that a[i] < a[j] < a[k] and i < j < k in 0(n)… Read More »

Given an unsorted array that contains even number of occurrences for all numbers except two numbers. Find the two numbers which have odd occurrences in… Read More »

You are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in… Read More »

Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is… Read More »

Given an array of random numbers. Find longest increasing subsequence (LIS) in the array. I know many of you might have read recursive and dynamic programming… Read More »

Given an array of n positive integers. Write a program to find the sum of maximum sum subsequence of the given array such that the… Read More »

Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples : Input: arr[] = {1, 4, 20,… Read More »

Create a data structure twoStacks that represents two stacks. Implementation of twoStacks should use only one array, i.e., both stacks should use the same array… Read More »

Write a function to count number of smaller elements on right of each element in an array. Given an unsorted array arr[] of distinct integers,… Read More »

Difficulty Level: Rookie Given a stream of numbers, print average (or mean) of the stream at every point. For example, let us consider the stream… Read More »

Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array. Examples : Input: arr[] = {8,… Read More »

Given an array A[0 … n-1] containing n positive integers, a subarray A[i … j] is bitonic if there is a k with i <=… Read More »

Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is… Read More »

Given a boolean matrix mat[M][N] of size M X N, modify it such that if a matrix cell mat[i][j] is 1 (or true) then make… Read More »

Given a 2D array, print it in spiral form. See the following examples. Examples: Input: 1 2 3 4 5 6 7 8 9 10… Read More »