1.

How much space does construction of suffix tree takes?(a) O (log M)(b) Exponential to Length of Tree(c) O (M!)(d) Linear to Length of TreeOrigin of the question is Suffix Tree topic in section Trie of Data Structures & Algorithms IThis question was addressed to me at a job interview.

Answer»

Correct option is (d) Linear to Length of Tree

The explanation is: 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 SPACE taken for construction of a suffix tree is linear to the length of the tree.



Discussion

No Comment Found

Related InterviewSolutions