# Category Archives: Advanced Data Structure

## B-Tree Insert without aggressive splitting

B-Tree Insert without aggressive splitting This algorithm for insertion takes an entry, finds the leaf node where it belongs, and inserts it there. We recursively… Read More »

## m-Way Search Tree | Set-2 | Insertion and Deletion

Insertion in an m-Way search tree: The insertion in an m-Way search tree is similar to binary trees but there should be no more than… Read More »

## Index of kth set bit in a binary array with update queries

Given a binary array arr[] and q queries of following types: k: find the index of the kth set bit i.e. kth 1 in the… Read More »

## Arrange array elements such that last digit of an element is equal to first digit of the next element

Given an array arr[] of integers, the task is to arrange the array elements such that the last digit of an element is equal to… Read More »

## Count of strings whose prefix match with the given string to a given length k

Given an array of strings arr[] and given some queries where each query consists of a string str and an integer k. The task is… Read More »

## Queries to update a given index and find gcd in range

Given an array arr[] of N integers and queries Q. Queries are of two types: Update a given index ind by X. Find the gcd… Read More »

## Introduction to R-tree

R-tree is a tree data structure used for storing spatial data indexes in an efficient manner. R-trees are highly useful for spatial data queries and… Read More »

## Find triplet such that number of nodes connecting these triplets is maximum

Given a Tree with N nodes, the task is to find a triplet of nodes (a, b, c) such that the number of nodes covered… Read More »

## Range Queries to Find number of sub-arrays with a given xor

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

## Lazy Propagation in Segment Tree | Set 2

Given an array arr[] of size N. There are two types of operations: Update(l, r, x) : Increment the a[i] (l <= i <= r)… Read More »

## Given an array and two integers l and r, find the kth largest element in the range [l, r]

Given an unsorted array arr[] of n integers and an integer k, the task is to find the kth largest element in the given index… Read More »

## Find a pair from the given array with maximum nCr value

Given an array arr[] of n positive integers. The task is to find elements arr[i] and arr[j] from the array such that arr[i]Carr[j] is maximum… Read More »

## Remove minimum elements from either side such that 2*min becomes more than max | Set 2

Given an unsorted array, trim the array such that twice of minimum is greater than the maximum in the trimmed array. Elements should be removed… Read More »

## Count of words that are present in all the given sentences

Given n sentences. The task is to count the number of words that appear in all of these sentences. Note that every word consists of… Read More »

## Program to implement Run Length Encoding using Linked Lists

Given a Linked List as the input. The task is to encode the given linked list using Run Length Encoding. That is, to replace a… Read More »