What is a time complexity for finding the longest palindromic substring in a string by using the generalized suffix tree?

What is a time complexity for finding the longest palindromic substring in a string by using the generalized suffix tree?
A. Linear Time
B. Exponential Time
C. Logarithmic Time
D. Cubic Time
 
Answer: a
Explanation: Palindrome is a string that is same when reading forward as well as backward. The time complexity for finding the longest palindromic substring in a string by using generalized suffix tree is linear time.
 

Tìm kiếm

Back
Top