1.

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 TimeThe above asked question is from Suffix tree in section Trie of Data Structures & Algorithms II got this question in an online interview.

Answer»

Right option is (a) Linear Time

The explanation is: 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.



Discussion

No Comment Found

Related InterviewSolutions