Given an array of numbers find the maximum XOR value of two numbers in the array.

Input Array = {12, 15, 5, 1, 7, 9, 8, 6, 10, 13}; Output = 15 (XOR of 5 and 10) 5 = 0101 10 = 1010 --------- XOR = 1111

May 022017

Given an array of numbers find the maximum XOR value of two numbers in the array.

Input Array = {12, 15, 5, 1, 7, 9, 8, 6, 10, 13}; Output = 15 (XOR of 5 and 10) 5 = 0101 10 = 1010 --------- XOR = 1111

May 012017

Given a collection of words stored in a Trie data structure, write a function that print all the words stored in it. For example, If the Trie is

Then output should be:

at ate bad bed beat beard

May 012017

String matching is a big research area and there are many data structure (eg. B-Tree, HashMap, Set) that help indexing of strings. There are also many algorithms used for string matching (like KMP, etc.)

The major application of Trie data structure is in storing a dictionary (Collection of strings) such the searching for a word in dictionary become O(k) time operation where k is the number of characters in the word. Continue reading »