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


Can anyone help me

I need to iterate through all substrings in order first [1...1],  then [1...2], [1...3], ..., [1...n], [2...2], [2...3], ..., [2...n], ..? What is the advantage of using trie in it?Also how to calculate Longest Common Prefix using trie?In this question we will just iterate through the substrings and count the no of bad ones in it .how we will apply trie?

asked 31 Aug '17, 15:28

dgupta's gravatar image

accept rate: 0%

edited 31 Aug '17, 15:40

Depends on what you want to do. If you only want to iterate over the substrings, a trie will have no advantage at all. Also for LCP a regular trie will have no advantage. You should use a Suffix trie for that task.

(31 Aug '17, 15:54) afaxnraner6★

Refer to this tutorial to learn about trie data-structure.
Hope it helps answer all your doubts.


answered 31 Aug '17, 15:49

axel_81's gravatar image

accept rate: 100%

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: 31 Aug '17, 15:28

question was seen: 127 times

last updated: 31 Aug '17, 15:57