## BK-Tree | Introduction & Implementation

BK Tree or Burkhard Keller Tree is a data structure that is used to perform spell check based on Edit Distance (Levenshtein distance) concept. BK… Read More »

- Sort the array of strings according to alphabetical order defined by another string
- 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
- Range Sum Queries and Update with Square Root
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Count of strings whose prefix match with the given string to a given length k
- Range and Update Sum Queries with Factorial
- Range Queries to Find number of sub-arrays with a given xor
- Lazy Propagation in Segment Tree | Set 2
- Program to implement Run Length Encoding using Linked Lists
- Persistent Trie | Set 1 (Introduction)
- Queries for Composite numbers in subarray (With Point Updates)
- Find a pair from the given array with maximum nCr value
- Find triplet such that number of nodes connecting these triplets is maximum
- Queries to update a given index and find gcd in range
- B-Tree Insert without aggressive splitting
- Introduction to R-tree
- 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
- Find the number of different numbers in the array after applying the given operation q times

BK Tree or Burkhard Keller Tree is a data structure that is used to perform spell check based on Edit Distance (Levenshtein distance) concept. BK… Read More »

We encounter various problems like Maximum length palindrome in a string, number of palindromic substrings and many more interesting problems on palindromic substrings . Mostly… Read More »

Given a dictionary find out if given word can be made by two words in the dictionary. Note: Words in the dictionary must be unique… Read More »

Given a list of words, find if any of the two words can be joined to form a palindrome. Examples: Input : list[] = {“geekf”,… Read More »

Given a dictionary and a character array, print all valid words that are possible using characters from the array. Examples: Input : Dict – {“go”,”bat”,”me”,”eat”,”goal”,… Read More »

We have seen various methods with different Time Complexities to calculate LCA in n-ary tree:- Method 1 : Naive Method ( by calculating root to… Read More »

A ScapeGoat tree is a self-balancing Binary Search Tree like AVL Tree, Red-Black Tree, Splay Tree, ..etc. Search time is O(Log n) in worst case.… Read More »

Given a dictionary, a method to do lookup in dictionary and a M x N board where every cell has one character. Find all possible… Read More »

Prerequisite : Segment Tree Persistency in Data Structure Segment Tree is itself a great data structure that comes into play in many cases. In this… Read More »

Prerequisite : Introduction and DFS The task is to find LCA of two given nodes in a tree (not necessarily a Binary Tree). In previous… Read More »

Given a string S, and two type of queries. Type 1: 1 L x, Indicates update Lth index of string S by x character. Type… Read More »

Given n strings and a weight associated with each string. The task is to find the maximum weight of string having the given prefix. Print… Read More »

In previous posts, we have discussed how to calculate the Lowest Common Ancestor (LCA) for a binary tree and a binary search tree (this, this… Read More »

Given a Binary Matrix. The task is to find the pair of row in the Binary matrix that has maximum bit difference Examples: Input: mat[][]… Read More »

Given a string of length n of lowercase alphabet characters, we need to count total number of distinct substrings of this string. Examples: Input :… Read More »