Longest Palindromic Substring (Longest Palindromic Substring)

From Algorithm Wiki
Revision as of 08:23, 10 April 2023 by Admin (talk | contribs)
Jump to navigation Jump to search

Description

Given a string of length $n$, find the palindromic substrings of maximal length.

Parameters

$n$: length of given string

Table of Algorithms

Name Year Time Space Approximation Factor Model Reference
Naive 1940 $O(n^{3})$ $O({1})$ Exact Deterministic Space
Dynamic Programming 1953 $O(n^{2})$ $O(n^{2})$ Exact Deterministic Space
Manacher 1975 $O(n)$ $O(n)$ Exact Deterministic Time
Jeuring 1994 $O(n)$ $O(n)$? Exact Deterministic Time
Gusfield 1997 $O(n)$ $O(n)$ Exact Deterministic Time

Time Complexity Graph

Error creating thumbnail: Unable to save thumbnail to destination

Space Complexity Graph

Error creating thumbnail: Unable to save thumbnail to destination

Time-Space Tradeoff

Error creating thumbnail: Unable to save thumbnail to destination