You are not logged in. Please login at www.codechef.com 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

1★ayushagg31
2417
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++

link

answered 15 Jun '17, 09:49

aashutosh001's gravatar image

3★aashutosh001
61
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.

https://www.codechef.com/viewsolution/13458296

problem https://www.codechef.com/MAY17/problems/WSITES01/

Let me know if you still have doubts

Also try this link : http://codeforces.com/blog/entry/13622

link

answered 15 Jun '17, 09:50

dragonemperor's gravatar image

3★dragonemperor
89321135
accept rate: 10%

edited 15 Jun '17, 10:18

toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×832
×47

question asked: 15 Jun '17, 09:08

question was seen: 1,200 times

last updated: 15 Jun '17, 15:05