πŸ“Š Design and Analysis of Algorithms
Q. In the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to the length of the string.
  • (A) true
  • (B) false
  • (C) answer: b
  • (D) explanation: in the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to length of the string minus one. for example, consider the string “abc”. the string can be converted to “abcba
πŸ’¬ Discuss
βœ… Correct Answer: (B) false

Explanation: the string can be converted to “efgfe” by inserting “f” or to “egfge” by inserting “g”. thus, only one insertion is required.


Explanation by: Mr. Dubey
the string can be converted to “efgfe” by inserting “f” or to “egfge” by inserting “g”. thus, only one insertion is required.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
976
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate