Tree data structure used for efficient retrieval of strings.
Up until now we have looked at Trie and the various functions that can be performed on it like searching, insertion and fniding prefix. An important application of bitwise operations in tries is XO...
Problem Statement: Given a string array nums of length n. A string is called a complete string if every prefix of this string is also present in the array nums. Find the longest complete string in...
Problem Statement: Given an m*n “board” of characters and a list of strings “words”, return all the words present on the board. Each word that you look up on the board must be constructed f...
Problem Statement: Given an array of non-negative integers and an array of queries where each query is a pair of two non-negative integers ie. [Xi, Ai], the answer to the ith query is the maximum b...
Problem Description: Implement a program that takes a string 'S' as input and returns the number of distinct substrings of the given string, including the empty substring. Use a trie data structure...
Problem Statement: Implement "TRIE” data structure from scratch with the following functions. Trie(): Initialize the object of this “TRIE” data structure. insert(“WORD”): Insert the strin...
Problem Statement: Implement the Trie class: Trie(): Initializes the trie object. void insert (String word): Inserts the string word into the trie. boolean search (String word): Returns true if the...
Problem Statement: Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 Examples Input: nums = [3, 9, 10, 5, 1] Output: 15 Explanation: The maximum XOR value is 10...