Longest word in ternary search tree
Given a set of words represented in a ternary search tree, find the length of largest word among them. Examples: Input : {“Prakriti”, “Raghav”, “Rashi”,… Read More »
Given a set of words represented in a ternary search tree, find the length of largest word among them. Examples: Input : {“Prakriti”, “Raghav”, “Rashi”,… Read More »
A Trie is used to store dictionary words so that they can be searched efficiently and prefix search can be done. The task is to… Read More »
Given an array of integers with limited range (0 to 1000000). We need to implement an Order statistic tree using fenwick tree. It should support… Read More »
A leftist tree or leftist heap is a priority queue implemented with a variant of a binary heap. Every node has an s-value (or rank… Read More »
Trie is an efficient information retrieval data structure. In our previous post on trie we have discussed about basics of trie and how to insert… Read More »
In the SET 1 post on TST we have described how to insert and search a node in TST. In this article we will discuss… Read More »
In previous article Skip List | Set 2 (Insertion) we discussed the structure of skip nodes and how to insert an element in the skip… Read More »
We have already discussed the idea of Skip list and how they work in Skip List | Set 1 (Introduction). In this article, we will… Read More »
You are given a number of queries Q and each query will be of the following types: Query 1 : add(x) This means add x… Read More »
Quadtrees are an effective method to store and locate data of points in a two-dimensional plane. Another effective use of quadtrees is in the field… Read More »
Given a array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task… Read More »
Given an array ‘a[]’ and number of queries q there will be two type of queries Query 0 update(i, v) : Two integers i and… Read More »
We have an array arr[0 . . . n-1]. There are two type of queries Find the XOR of elements from index l to r… Read More »
Given an array where each element is a vector containing integers in sorted order. The task is to answer following queries: count(start, end, k) :… Read More »
It is recommended to refer following post as prerequisite of this post. Splay Tree | Set 1 (Search) Following are the different cases to delete… Read More »