You are not logged in. Please login at www.codechef.com 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], ..? http://codeforces.com/blog/entry/6662 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

0★dgupta
175
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.
https://www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/tutorial/
Hope it helps answer all your doubts.

link

answered 31 Aug '17, 15:49

axel_81's gravatar image

5★axel_81
1714
accept rate: 100%

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:

×2,541
×154

question asked: 31 Aug '17, 15:28

question was seen: 123 times

last updated: 31 Aug '17, 15:57