## Number of triplets in array having subarray xor equal

Given an array of integers Arr. The task is to count the number of triplets (i, j, k) such that Ai ^ Ai+1 ^ Ai+2… Read More »

## Maximise the number of toys that can be purchased with amount K using min Heap

Given an array arr[] consisting of the cost of toys and an integer K depicting the amount of money available to purchase toys. The task… Read More »

## Count inversions in an array | Set 4 ( Using Trie )

Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted then inversion… Read More »

## Lexicographical ordering using Heap Sort

Given an array arr[] of strings. The task is to sort the array in lexicographical order using Heap Sort. Examples: Input: arr[] = { “banana”,… Read More »

## Need for Abstract Data Type and ADT Model

Prerequisite: Abstract Data Types or ADT Why Abstract Data Type became a necessity? Earlier if a programmer wanted to read a file, the whole code… Read More »

## Shortest cycle in an undirected unweighted graph

Given an undirected unweighted graph. The task is to find the length of the shortest cycle in the given graph. If no cycle exists print… Read More »

## Van Emde Boas Tree | Set 4 | Deletion

It is highly recommended to read the previous articles on Van Emde Boas Tree first. Procedure for Delete: Here we are assuming that the key… Read More »

## Queries for the number of nodes having values less than V in the subtree of a Node

Given a rooted tree (assume root is 1) of N nodes and Q queries, each of the form (Val, Node). For each query, the task… Read More »

## Van Emde Boas Tree – Set 3 | Successor and Predecessor

It is highly recommended to read the previous articles on Van Emde Boas Tree first. Procedure for successor: Base case: If the size of the… Read More »

## String Range Queries to find the number of subsets equal to a given String

Given a string S of length N, and M queries of the following type: Type 1: 1 L x, Indicates update Lth index of string… Read More »

## Queries for number of distinct elements in a subarray | Set 2

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

## Pairing Heap

Pairing Heap is like a simplified form Fibonacci Heap. It also maintains the property of min heap which is parent value is less than its… Read More »

## Van Emde Boas Tree | Set 2 | Insertion, Find, Minimum and Maximum Queries

It is highly recommended to see previous articles on Van Emde Boas Tree first. Procedure for Insert : If no keys are present in the… Read More »

## Count smaller elements on right side and greater elements on left side using Binary Index Tree

Given an array arr[] of size N. The task is to find smaller elements on the right side and greater elements on the left side… Read More »

## Extendible Hashing (Dynamic approach to DBMS)

Extendible Hashing is a dynamic hashing method wherein directories, and buckets are used to hash data. It is an aggressively flexible method in which the… Read More »