## Multiset Equivalence Problem

The multiset equivalence problem states to check if two given multisets are equal or not. For example let A = {1, 2, 3} and B… Read More »

The multiset equivalence problem states to check if two given multisets are equal or not. For example let A = {1, 2, 3} and B… Read More »

Given an array of distinct elements. The task is to find triplets in array whose sum is equal to a given number. Examples: Input :… Read More »

Given an array of integers, and a number ‘sum’, print all pairs in the array whose sum is equal to ‘sum’. Examples : Input :… Read More »

Prerequisite – Hashing Introduction, Hashtable using Singly Linked List & Implementing our Own Hash Table with Separate Chaining in Java Implementing hash table using Chaining… Read More »

Coalesced hashing is a collision avoidance technique when there is a fixed sized data. It is a combination of both Separate chaining and Open addressing.… Read More »

Given an array where every element occurs a times, except one element which occurs b (a>b) times. Find the element that occurs b times. Examples:… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. Distance between… Read More »

Inverted Index It is a data structure that stores mapping from words to documents or set of documents i.e. directs you from word to document.… Read More »

An inverted index is an index data structure storing a mapping from content, such as words or numbers, to its locations in a document or… Read More »

Given a string, print the longest substring without repeating characters. For example, the longest substrings without repeating characters for “ABDEFGABEF” are “BDEFGA” and “DEFGAB”, with… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. The distance… Read More »

Pre-requisite : set in C++, unordered_set in C++ Differences : | set | unordered_set ——————————————————— Ordering | increasing order | no ordering | (by default)… Read More »

Consider a tree with n nodes and root. You can jump from one node to any other node on the same height a maximum of… Read More »

Given an array of n-positive elements. Sub-array sum is defined as the sum of all elements of a particular sub-array, the task is to find… Read More »

Given n elements, write a program that prints the longest increasing subsequence whose adjacent element difference is one. Examples: Input : a[] = {3, 10,… Read More »