Homework 4 - Standard Template Libraries

Due: Wednesday October 17, 2007 at 5pm

Implement the following nested menu programs using the STL versions of list, stack, queue and dequeue. Instantiate each STL as an integer data structure (i.e. an integer linked list). A nested menu program has multiple menus that are selected from a main menu. When the program is first invoked, the main menu is presented. Options on the main menu give access to the sub-menus. For this assignment, use the following main menu:

   Welcome to the CS223 Homework 4 Menu
==========================================
1.  Test the linked list STL
2.  Test the stack STL
3.  Test the queue STL
4.  Test the deque STL

0.  Exit
==========================================
The submenus are defined as follows.

Linked List Menu

When Option 1 is selected, the linked list menu will be printed and the user can select any item off the linked list menu. When the user exits the linked list menu, they will return back to the Homework 5 menu. Do not exist the program until the user selects Option 0 in the Homework 5 menu.
             Linked List Menu
+++++++++++++++++++++++++++++++++++++++++++++++++
1. Insert a value at the front of the list
2. Insert a value at the back of the list
3. Insert a value at a given position in the list
4. Search the list for a value
5. Delete all instances of a value
6. Print the list contents

0. Return to main homework menu
+++++++++++++++++++++++++++++++++++++++++++++++++

Stack Menu

The stack menu is printed when Option 2 from the main homework menu is selected. As with the linked list menu, the stack menu should return to the main homework menu when the user selects Option 0.
            Stack Menu
------------------------------------------
1. Push a value onto the stack
2. Pop a value off of the stack
3. Print the value at the top of the stack

0. Return to main homework menu
------------------------------------------

Queue Menu

The queue menu is printed when Option 3 is selected from the main homework menu. As with the other two menus, selecting Option 0 in the queue menu should bring the user back to the main homework menu.
            Queue Menu
##################################
1. Add a value to the queue
2. Remove a value from the queue
3. Print the front element
4. Print the back element

0. Return to main homework menu
##################################

Deque Menu

The deque menu is printed when Option 4 is selected from the main homework menu. As with the other two menus, selecting Option 0 in the queue menu should bring the user back to the main homework menu.
            Deque Menu
****************************************
1. Add a value to the front of the deque
2. Add a value to the back of the deque
3. Print the front element
4. Print the back element
5. Remove the front element
6. Remove the back element

0. Return to main homework menu
****************************************