## Gomory-Hu Tree | Set 1 (Introduction)

Background : In a flow network, an s-t cut is a cut that requires the source ‘s’ and the sink ‘t’ to be in different… Read More »

- Design a Chess Game
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Kth smallest element in a subarray
- Rearrange numbers in an array such that no two adjacent numbers are same
- Lazy Propagation in Segment Tree | Set 2
- Trie Data Structure using smart pointer and OOP in C++
- Range Queries to Find number of sub-arrays with a given xor
- Implement a Dictionary using Trie
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Longest string in an array which matches with prefix of the given string
- Persistent Trie | Set 1 (Introduction)
- Count of strings whose prefix match with the given string to a given length k
- Sort an array of strings based on the frequency of good words in them
- Introduction to R-tree
- Flipping Sign Problem | Lazy Propagation Segment Tree
- Queries to update a given index and find gcd in range
- Find triplet such that number of nodes connecting these triplets is maximum
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Find the number of different numbers in the array after applying the given operation q times
- Gap Buffer Data Structure
- Find a pair from the given array with maximum nCr value
- Bottom-up traversal of a Trie
- B-Tree Insert without aggressive splitting
- Search in a trie Recursively
- Arrange array elements such that last digit of an element is equal to first digit of the next element
- Queries for number of distinct elements in a subarray | Set 2
- Strings from an array which are not prefix of any other string
- Index of kth set bit in a binary array with update queries
- Insertion in a Trie recursively
- B*-Trees implementation in C++

Background : In a flow network, an s-t cut is a cut that requires the source ‘s’ and the sink ‘t’ to be in different… Read More »

Background Suffix Array : A suffix array is a sorted array of all suffixes of a given string. Let the given string be “banana”. 0… Read More »

We have discussed below data structures in previous two sets. Set 1 : Overview of Array, Linked List, Queue and Stack. Set 2 : Overview… Read More »

We strongly recommend to refer below post as a prerequisite of this. Heavy Light Decomposition | Set 1 (Introduction) In the above post, we discussed… Read More »

Heavy Light decomposition (HLD) is one of the most used techniques in competitive programming. Example Problem: Let us understand Heavy-light decomposition (HLD) with the help… Read More »

Given an array arr[] of size n. Three elements arr[i], arr[j] and arr[k] form an inversion of size 3 if a[i] > a[j] >a[k] and… Read More »

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

The article describes an approach to solving the problem of finding the LCA of two nodes in a tree by reducing it to a RMQ… Read More »

We have an array arr[0 . . . n-1]. We should be able to efficiently find the minimum value from index L (query start) to… Read More »

Given an array of integers. find the maximum XOR subarray value in given array. Expected time complexity O(n). Examples: Input: arr[] = {1, 2, 3,… Read More »

We strongly recommend to refer set 1 as a prerequisite of this post. Treap (A Randomized Binary Search Tree) In this post, implementations of search,… Read More »

Like Red-Black and AVL Trees, Treap is a Balanced Binary Search Tree, but not guaranteed to have height as O(Log n). The idea is to… Read More »

Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is prefix of… Read More »

Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity,… Read More »

We strongly recommend to refer below posts as a prerequisite of this. K Dimensional Tree | Set 1 (Search and Insert) K Dimensional Tree |… Read More »