## Range maximum query using Sparse Table

Given an array arr[], the task is to answer queries to find the maximum of all the elements in the index range arr[L…R]. Examples: Input:… Read More »

- Design a Chess Game
- Kth smallest element in a subarray
- Implement a Dictionary using Trie
- Rearrange numbers in an array such that no two adjacent numbers are same
- Trie Data Structure using smart pointer and OOP in C++
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Persistent Trie | Set 1 (Introduction)
- Sort an array of strings based on the frequency of good words in them
- Longest string in an array which matches with prefix of the given string
- Count of strings whose prefix match with the given string to a given length k
- Queries for number of distinct elements in a subarray | Set 2
- Flipping Sign Problem | Lazy Propagation Segment Tree
- Search in a trie Recursively
- Extendible Hashing (Dynamic approach to DBMS)
- Find the number of different numbers in the array after applying the given operation q times
- Bottom-up traversal of a Trie
- Gap Buffer Data Structure
- Count inversions in an array | Set 4 ( Using Trie )
- String Range Queries to find the number of subsets equal to a given String
- B*-Trees implementation in C++
- Insertion in a Trie recursively
- B-Tree Insert without aggressive splitting
- Shortest cycle in an undirected unweighted graph
- Van Emde Boas Tree | Set 1 | Basics and Construction
- Strings from an array which are not prefix of any other string
- Maximise the number of toys that can be purchased with amount K using min Heap
- Arrange array elements such that last digit of an element is equal to first digit of the next element
- Index of kth set bit in a binary array with update queries
- Number of triplets in array having subarray xor equal
- Proto Van Emde Boas Tree | Set 2 | Construction

Given an array arr[], the task is to answer queries to find the maximum of all the elements in the index range arr[L…R]. Examples: Input:… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 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 »

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 »

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 »