## Red-Black Tree | Set 2 (Insert)

In the previous post, we discussed introduction to Red-Black Trees. In this post, insertion is discussed. In AVL tree insertion, we used rotation as a… Read More »

- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Number of subarrays have bitwise OR >= K
- Count of words that are present in all the given sentences
- Count of strings whose prefix match with the given string to a given length k
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Lazy Propagation in Segment Tree | Set 2
- Longest string in an array which matches with prefix of the given string
- Persistent Trie | Set 1 (Introduction)
- Range Queries to Find number of sub-arrays with a given xor
- Program to implement Run Length Encoding using Linked Lists
- Rearrange numbers in an array such that no two adjacent numbers are same
- Introduction to R-tree
- Find a pair from the given array with maximum nCr value
- Queries for Composite numbers in subarray (With Point Updates)
- Find triplet such that number of nodes connecting these triplets is maximum
- Queries to update a given index and find gcd in range
- Find the number of different numbers in the array after applying the given operation q times
- B-Tree Insert without aggressive splitting
- 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

In the previous post, we discussed introduction to Red-Black Trees. In this post, insertion is discussed. In AVL tree insertion, we used rotation as a… Read More »

Red-Black Tree is a self-balancing Binary Search Tree (BST) where every node follows following rules. 1) Every node has a color either red or black.… Read More »

We strongly recommend to read following post on suffix trees as a pre-requisite for this post. Pattern Searching | Set 8 (Suffix Tree Introduction) A… Read More »

It is recommended to refer following post as prerequisite of this post. Splay Tree | Set 1 (Search) As discussed in the previous post, Splay… Read More »

The worst case time complexity of Binary Search Tree (BST) operations like search, delete, insert is O(n). The worst case occurs when the tree is… Read More »

The worst case search time for a sorted linked list is O(n). With a Balanced Binary Search Tree, we can skip almost half of the… Read More »

It is recommended to refer following posts as prerequisite of this post. B-Tree | Set 1 (Introduction) B-Tree | Set 2 (Insert) B-Tree is a… Read More »

Consider a coding system for alphabets to integers where ‘a’ is represented as 1, ‘b’ as 2, .. ‘z’ as 26. Given an array of… Read More »

Given a dictionary of words and an input string, find the longest prefix of the string which is also a word in dictionary. Examples: Let… Read More »

In the previous post, we introduced B-Tree. We also discussed search() and traverse() functions. In this post, insert() operation is discussed. A new key is… Read More »

B-Tree is a self-balancing search tree. In most of the other self-balancing search trees (like AVL and Red-Black Trees), it is assumed that everything is… Read More »

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 »