Implemented and used trie data structure

Signed-off-by: Vineel Kumar Reddy Kovvuri <vineelkumarreddy@gmail.com>