Question: 4. Write an algorithm in pseudo-code that would describe how to use a stack to reverse a sequence (list) of letters and print them. For
4. Write an algorithm in pseudo-code that would describe how to use a stack to reverse a sequence (list) of letters and print them. For instance, if the original sequence is COMPUTER the output will be RETUPMOC. Review pages 249-250 of the textbook (Chapter8) to see the related sample pseudo-codes. 5. A palindrome word is one that has the same sequence of letters if you read it from right to left or left to right (e.g, radar or madam). Describe (in terms of a pseudo-code) how you could use a stack in conjunction with the original list to determine if a sequence is a palindrome. Hint: Given that the letters have been already assigned to both stack and the queue and these two data structures are ready to be processed (compared)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
