The longest decreasing subsequence problem is to find a subsequence of a given sequence in which the subsequence’s elements are in sorted order, highest to lowest, and in which the subsequence is as long as possible.
Given an unsorted array of integers, print all distinct four elements tuple (Quadruplets) in it having given sum.
Given an unsorted array of integers, check if it contains four elements tuple (Quadruplets) having given sum.
Given an array of integers, find minimum and maximum element present in it by doing minimum comparisons.
Given an array where all its elements are sorted except two elements which were swapped, sort the array in linear time. Assume there are no duplicates in the array.
Implement Quicksort algorithm using Hoare’s Partitioning scheme.
Given an unsorted array of integers, find a triplet with given sum in it.
Given M sorted lists of variable length, print them in sorted order efficiently.
In this post, we will discuss the differences between ArrayList and LinkedList in Java.
Given a collection of n items, each of which has a non-negative integer key whose maximum value is at most k, effectively sort it using counting sort algorithm.
Given two Boolean arrays X and Y, find the length of longest continuous sequence that starts and ends at same index in both arrays and have same sum. In other words, find max(j-i+1) for every j >= i where sum of sub-array X[i, j] is equal to sum of sub-array Y[i, j].
Given an array with many duplicated elements, write an algorithm to efficiently sort it in linear time where the order of equal elements doesn’t matter.