What is a time complexity for finding frequently occurring of a substring of minimum length in a string?

Category: QuestionsWhat is a time complexity for finding frequently occurring of a substring of minimum length in a string?
Editor">Editor Staff asked 1 month ago

What is a time complexity for finding frequently occurring of a substring of minimum length in a string?
 
(a) Ɵ (n)
 
(b) Ɵ (n!)
 
(c) O (n^2+ n1)
 
(d) O (log n!)
 
This interesting question is from Suffix tree in division Trie of Data Structures & Algorithms I
 
I got this question during an internship interview.

1 Answers
Editor">Editor Staff answered 1 month ago

Right choice is (a) Ɵ (n)
 
The best explanation: Suffix Tree 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 finding frequently occurring of a substring of minimum length in a string is Ɵ (n).