
Lesson 17-4: STL Containers
Introduction to Data Structures Using the Standard Template Library | 443
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: Using a stack template and a queue template, write a palindrome checker. That is,
read in a line and see if it reads the same forward and backward. For example, “eye,” “racecar,”
and “never odd or even” are palindromes. Notice that blanks need to be ignored. Hint: Put the
alphabetic characters into a stack and a queue and compare them.
Exercise 2: Repeat the task in Exercise 1, using the list template.
78828_CH17_DaleLab ...