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

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!)
 
Answer: a
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).
 

Tìm kiếm

Back
Top