proto van Emde Boas Trees | Set 1 (Background and Introduction)
Let us consider the below problem statement and think of different solutions for it. Given a set S of elements such that the elements are… Read More »
Let us consider the below problem statement and think of different solutions for it. Given a set S of elements such that the elements are… Read More »
Given a list of contacts which exist in a phone directory. The task is to implement search query for the phone directory. The search query… Read More »
Given an array arr[0..n-1]. The following operations need to be performed. update(l, r, val) : Add ‘val’ to all the elements in the array from… Read More »
Given a size n in which initially all elements are 0. The task is to perform multiple multiple queries of following two types. The queries… Read More »
Given an array arr[0..n-1]. The following operations need to be performed. update(l, r, val) : Add ‘val’ to all the elements in the array from… Read More »
Given an array arr[0 . . . n-1]. We need to efficiently find the minimum and maximum value from index qs (query start) to qe… Read More »
Given a dictionary of words where each word follows CamelCase notation, print all words in the dictionary that match with a given pattern consisting of… Read More »
Given an array of integers, evaluate queries of the form LCM(l, r). There might be many queries, hence evaluate the queries efficiently. LCM (l, r)… Read More »
Prerequisites : BIT, DFS Given a rooted tree T, with ‘n’ nodes, each node has a color denoted by the array color[](color[i] denotes the color… Read More »
Prerequisites : Suffix Array | Set 2 kasai’s algorithm The Longest Common Extension (LCE) problem considers a string s and computes, for each pair (L… Read More »
Prerequisite – Fenwick Tree We know that to answer range sum queries on a 1-D array efficiently, binary indexed tree (or Fenwick Tree) is the… Read More »
Pre-requisite : BIT(Binary Indexed Tree or Fenwick Tree), 2D BIT Given a 2D plane, respond to Q queries, each of the following type: Insert x… Read More »
Given an empty set initially and a number of queries on it, each possibly of the following types: Insert – Insert a new element ‘x’.… Read More »
Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »
Given a very long list of URLs, find out last unique URL. Only one traversal of all URLs is allowed. Examples: Input: https://www.geeksforgeeks.org http://quiz.geeksforgeeks.org http://qa.geeksforgeeks.org… Read More »