
CS 302 Assignment 3:
Using Stacks.
Due date: Thursday, March 7, 2013, midnight.
All programming assignments must be
submitted electronically.
Submit them to the graduate assistant,
Jimi Andro-Vasko, by email at
androvas"at"unlv"dot"nevada"dot"edu
on or before the due date.
Your email must come from your university or engineering college account,
and your programs must compile and run on College computers.
The assignment is to write four programs.
This is a smaller assignment that it seems, because the programs
will contain a large amount of common code.
-
Write a program which uses a stack to evaluate a postfix expression.
The operands will be single digit numerals, and the operations will
be addition, subtraction, multiplication, and division.
You must use the array implementation of stack.
-
Write a program which uses a stack to evaluate a postfix expression.
The operands will be single digit numerals, and the operations will
be addition, subtraction, multiplication, and division.
You must use the linked list implementation of stack.
-
Write a program that uses a stack to accept strings which
have matching parentheses, braces, and brackets.
All other symbols are to be ignored.
For example, the string "xA(5*[bz]{gbn-}3cT_)" will be accepted,
but the string "(a[b)xxzZ]" will not be.
You must use the array implementation of stack.
-
Write a program that uses a stack to accept strings which
have matching parentheses, braces, and brackets.
All other symbols are to be ignored.
For example, the string "xA(5*[bz]{gbn-}3cT_)" will be accepted,
but the string "(a[b)xxzZ]" will not be.
You must use the linked list implementation of stack.
The output of each program must be an appropriate message, indicating whether
the input string was accepted.