1.

What is a time complexity for x pattern occurrence of length n?(a) O (log n!)(b) Ɵ (n!)(c) O (n^2)(d) Ɵ (n + x)I want to ask this question from Suffix tree topic in portion Trie of Data Structures & Algorithms II have been asked this question in an online quiz.

Answer»

The correct option is (d) Ɵ (n + x)

The explanation is: Suffix tree is ALSO KNOWN as PAT tree or position tree. It allows fast string operation. To check if a substring is PRESENT in a string of a length of n, the time COMPLEXITY for such operation is found to be O (n). The time complexity for x pattern occurrence of length n is Ɵ (n + x).



Discussion

No Comment Found

Related InterviewSolutions