Given an unsorted array of integers, find a triplet with given sum in it.
Given an array of integers having distinct elements, find the surpasser count for each element in it. In other words, for each element of the array, find the number of elements to its right which are greater than it.
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.
Given an ancestor matrix, whose cell (i, j) has value true if i is ancestor of j in a binary tree, construct a binary tree from it where binary tree nodes are labelled from 0 to n-1 where n is the size of the ancestor matrix.
Given an array of sorted integers which may have several duplicates elements, count the number of distinct absolute values in the array.
Given a string and a pattern, determine if the pattern matches with the string or not. The solution should not use any regex.
Given an array of integers, check if array contains a sub-array having 0 sum.
Trie is a tree-based data structure used for efficient retrieval of a key in a huge set of strings. In this post, we will implement Trie data structure in Java.
Given an array of integers with all its elements between 1 to n with the exception of two elements which occur twice. Find two duplicate elements without using any extra memory.
Given an array of integers, find a subarray having given sum in it.
Given an array of integers, find largest sub-array formed by consecutive integers. The sub-array should contain all distinct values.
Given a limited range array of size n where array contains elements between 1 to n-1 with one element repeating, find the duplicate number in it.