How much time does construction of suffix tree take?

Category: QuestionsHow much time does construction of suffix tree take?
Editor">Editor Staff asked 4 weeks ago

How much time does construction of suffix tree take?
 
(a) O (log M)
 
(b) O (M!)
 
(c) Exponential to Length of Tree
 
(d) Linear to Length of Tree
 
My doubt stems from Suffix Tree topic in division Trie of Data Structures & Algorithms I
 
I have been asked this question in an online quiz.

1 Answers
Editor">Editor Staff answered 4 weeks ago

Right answer is (d) Linear to Length of Tree
 
The best I can explain: Suffix tree is also known as PAT tree or position tree. It is a compressed search tree or prefix tree in which keys contain the suffix of text values as the text position. It allows fast string operation. Total time taken for construction of suffix tree is linear to the length of the tree.