Question: (algorithms) Given any string of only lowercase letters a through z with exactly two of each letter present (for instance, aabb or acbebaec) develop an
(algorithms) Given any string of only lowercase letters a through z with exactly two of each letter present (for instance, aabb or acbebaec) develop an algorithm to transform it into a palindrome (for instance, abba or cbaeeabc) using the minimum number of the following moves.
(a) The only move available is: send a letter to the end of the string.
(b) The only two moves available are: a) one round of bubble sort (a single iteration, not until sorted). b) transpose a pair of adjacent letters.
Thanks!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
