Question: USE C++ to code this Question 1: A palindrome is a word (sequence of characters) that reads the same backward as forward (e.g. civic, refer).
USE C++ to code this
Question 1: A palindrome is a word (sequence of characters) that reads the same backward as forward (e.g. civic, refer). Write the most efficient algorithm (one for each data structure) to check if a word w is a palindrome by using: a.Stacks b.Queues c.Deques For each data structure, your input is a queue with the sequence of characters in the word. For instance, for the word "hello the input of your algorithm is a queue: (front) h, e, I, I, o (rear). If you need to duplicate the input queue or any other container (stack, queue, deque) you can use an operation duplicate(container) that runs in Oin) and returns a replica of the given container. Specify and justify your choice of implementation for each ADT being used (static array, incremental/doubling growable array, singly linked list, doubly linked list). Show the overall cost of your three algorithms and justify your answer. What is the best data structure among those three to solve the problem Explain why based on time and space costs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
