design an algorithm which takes an input string and return a palindrome

User Generated

plrzrpx

Programming

Description

Design an algorithm which takes an input string and return a palindrome by inserting the smallest number of letters. You are allowed to insert characters at any position of the string. For example, AAT can be turned into palindrome TAAT by one insertion T, and GCT into GCTCG with two insertions CG. Besides designing an algorithm you also need to provide the time complexity analysis (e.g. big--‐O notation).


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
Great study resource, helped me a lot.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags