299
правок
Изменения
→Псевдокод
<code style = "display: inline-block;">
'''palSubSeq'''(left, right)
'''if''' L[left][right] == -1 '''if''' s[left] == s[right]
L[left][right] = palSubSeq(left + 1, right - 1) + 2
'''else'''
'''palChars'''(left, right, l1, l2)
'''while''' left <tex>\le</tex> right
'''if''' left == right && L[left][right] == 1
Pal[l1++] = S[left] //массив Char для искомого палиндрома
left++
'''else'''
'''if''' s[left] == s[right]
Pal[l1++] = s[left]
Pal[l2--] = s[right]