Pagini recente » Profil Sunt_3l3v | Diferente pentru utilizator/yato2 intre reviziile 33 si 40 | Diferente pentru blog/linear-algebra intre reviziile 11 si 12 | Diferente pentru blog/rolling-hash intre reviziile 17 si 18 | Diferente pentru blog/rolling-hash intre reviziile 18 si 19
Nu exista diferente intre titluri.
Diferente intre continut:
h2. Largest palindrome
bq. Given a string of length n, find out it's largest palindromic subsequence.
bq. Given a string of length n, find out it's largest palindromic substring.
The naive solution is O(n^3^). For every possible subsequence it tests in linear time if it's a palindrome.
The naive solution is O(n^3^). For every possible substring it tests in linear time if it's a palindrome.
A smarter solution tries every position in the original string as the center of a palindrome and extends to the left and to the right as long as the corresponding characters match. This solution takes O(n^2^) time.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.