## Largest Rectangular Area in a Histogram | Set 1

Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity,… Read More »

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

Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. For simplicity,… Read More »

Can we search in a sorted linked list in better than O(n) time? The worst case search time for a sorted linked list is O(n)… Read More »

Design a Data Structure for the following operations. The data structure should be efficient enough to accommodate the operations according to their frequency. 1) findMin()… Read More »

We have introduced segment tree with a simple example in the previous post. In this post, Range Minimum Query problem is discussed as another example… Read More »

Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1… Read More »

A ternary search tree is a special trie data structure where the child nodes of a standard trie are ordered as a binary search tree.… Read More »

Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You may… Read More »

Given an array of words, print all anagrams together. For example, if the given array is {“cat”, “dog”, “tac”, “god”, “act”}, then output may be… Read More »

Given a binary matrix, print all unique rows of the given matrix. Example: Input: {0, 1, 0, 0, 1} {1, 0, 1, 1, 0} {0,… Read More »

How to implement LRU caching scheme? What data structures should be used? We are given total possible page numbers that can be referred. We are… Read More »

Given N machines. Each machine contains some numbers in sorted form. But the amount of numbers, each machine has is not fixed. Output the numbers… Read More »

Given a book of words. Assume you have enough main memory to accommodate all words. design a data structure to find top K maximum occurring… Read More »

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… Read More »

We have discussed AVL insertion in the previous post. In this post, we will follow a similar approach for deletion. Steps to follow for deletion.… Read More »

AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for… Read More »