You are not logged in. Please login at to post your questions!


Tries Implementation in C++

Hi team, I am looking for the simple implementation of Tries Data Structure in C++ with some descriptions of code which will make it easier to understand.I have gone through several codes available on net but all of them are lacking description.If you have your own code, then pls provide the description of your code, otherwise, your code is useless for me.

asked 15 Jun '17, 09:08

ayushagg31's gravatar image

accept rate: 9%

edited 15 Jun '17, 09:11

ok.......I have done reading trie implementation in c++, but one simple question arises, how can I return the count of words present in the trie starting with a prefix(here prefix being passed as an argument)?

(15 Jun '17, 15:05) ayushagg311★

I think this will help you : Simple trie implemented in C++

Or this : TRIE Implementaion in C++


answered 15 Jun '17, 09:49

aashutosh001's gravatar image

accept rate: 0%

Try reading online and if you understand the concept, following is my implementation in array (2D) which is faster than using actual tree (using malloc). Take a look and try to understand.


Let me know if you still have doubts

Also try this link :


answered 15 Jun '17, 09:50

dragonemperor's gravatar image

accept rate: 10%

edited 15 Jun '17, 10:18

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 15 Jun '17, 09:08

question was seen: 1,200 times

last updated: 15 Jun '17, 15:05