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

Category: QuestionsWhat is a time complexity for finding the longest palindromic substring in a string by using the generalized suffix tree?
Editor">Editor Staff asked 5 months ago

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

1 Answers
Editor">Editor Staff answered 5 months ago

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.


Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17

Notice: Trying to get property 'ID' of non-object in /home/fvckxqmi/public_html/wp-content/themes/blocksy/inc/single/single-helpers.php on line 17
Articles: 40702