Skip to content

Tag Archives: Trie

Given an array arr[] consisting of N strings and Q queries in form of two strings prefix and suffix, the task for each query is… Read More
Given an array arr[] consisting of N non-negative integers and a 2D array queries[][] consisting of queries of the type {X, M}, the task for… Read More
A trie is a data structure that stores strings like a tree data structure. The maximum number of children in a node is equal to… Read More
Given an array of strings str[] and a string key, the task is to check if the spelling of the key is correct or not.… Read More
Given an array of strings arr[], the task is to print all unique strings that are present in the given array. Examples: Input: arr[] =… Read More
Given an array of strings arr[], the task is to find the pair of strings from the given array whose length of the longest common… Read More
Given an array arr[]of size N and an integer K, the task is to count the number of pairs from the given array such that… Read More
Given an array arr[]of size N and an integer K, the task is to count the number of pairs from the given array such that… Read More
Given an array arr[] consisting of N integers, the task is to find the maximum Bitwise XOR from all the possible pairs in the given… Read More
Prerequisite: Trie | (Insert and Search) Given an array of strings words[] and a partial string str, the task is to find the strings of… Read More
Given a set of strings str, the task is to print all the joints of the Trie constructed from the given set of strings.  Joints… Read More
Given a set of strings S and a string P, the task is to print all strings from the set with suffix P. Examples: Input:… Read More
Given a big string and an array of small strings, all of which are smaller in length than the big string. The task is to… Read More
Given a set S with the initial element 0 that is S = { 0 }. The task is to perform each query when Q… Read More