Maximum Product Subset Problem
Given an integer array, find a subset in it having the maximum product of its elements.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven an integer array, find a subset in it having the maximum product of its elements.
Given a sorted array containing duplicates, efficiently find each element’s frequency without traversing the whole array.
Quickselect is a selection algorithm to find the k’th smallest element in an unordered list. It is closely related to the Quicksort sorting algorithm. Like Quicksort, it is efficient traditionally and offers good average-case performance, but has a poor worst-case performance.
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. This subsequence is not necessarily contiguous or unique.
4-sum problem: Given an unsorted integer array, check if it contains four elements tuple (quadruplets) having a given sum.
Given a graph, determine if it is bipartite using DFS. A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V.
Given an integer array, find the minimum and maximum element present in it by making minimum comparisons by using the divide-and-conquer technique.
Given three strings, return true if the third string is interleaving the first and second strings, i.e., it is formed from all characters of the first and second string, and the order of characters is preserved.
Find all n–digit numbers with an equal sum where n varies from 1 to 9 and sum <= 81 (Maximum possible sum in a 9–digit number).
Convert a given binary tree into a BST (Binary Search Tree) by keeping its original structure intact.
Implement the Quicksort algorithm using Hoare’s Partitioning scheme which is more efficient than Lomuto’s partition scheme because it does three times fewer swaps on average, and it creates efficient partitions even when all values are equal.
Given a normal binary tree, convert it into a Left–child right–sibling (LC–RS) binary tree. Each node in the LC–RS binary tree has two pointers: one to the node’s left child and one to its next sibling in the original binary tree.