Quickselect is a selection algorithm to find the kth smallest element in an unordered list. It is closely related to the quicksort sorting algorithm.
Given an unsorted array of integers, check if it contains four elements tuple (Quadruplets) having given sum.
Given a linked list, write a function which deletes any duplicate nodes from the list by traversing the list only once.
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.
Given a string, calculate its rank among all its lexicographically sorted permutations. For example, consider below lexicographically sorted permutations
The longest common subsequence (LCS) problem is the problem of finding the longest subsequence that is present in given two sequences in the same order. i.e. find a longest sequence which can be obtained from the first original sequence by deleting some items, and from the second original sequence by deleting other items.
Huffman Coding is a algorithm for doing data compression and it forms the basic idea behind file compression. This post talks about fixed length and variable length encoding, uniquely decodable codes, prefix rules and construction of Huffman Tree.
The longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence’s elements are in sorted order, lowest to highest, and in which the subsequence is as long as possible. This subsequence is not necessarily contiguous, or unique.
Given a schedule containing arrival and departure time of trains in a station, find minimum number of platforms needed in the station so to avoid any delay in arrival of any train.
Given a set of intervals, print all non-overlapping intervals after merging overlapping intervals.
Given an array of integers, find all distinct combinations of given length where repetition of elements is allowed.