1. Using the class java. tailstock, define a class Our Stack that implements the interface StackInterface, as given in Listing 5-1.
2. Use the class Our Stack from the previous project in a program that demonstrates the class BalanceChecker, as given in Listing 5-2. Whenever you need a stack for any of the following projects, use the class Our Stack that Project 1 asks you to define.
3. Write a Java program that uses a stack to test whether an input string is a palindrome. Exercise 11 defines “palindrome” and asks you to describe a solution to this problem.
4. Define a class Postfix that includes the static methods convertToPostfix and evaluatePostfix. These methods should implement the algorithms given in Segments 5.16 and 5.18, respectively. Assume that the given algebraic expressions are syntactically correct. The standard class StringBuilder, which is in the Java Class Library and is described in Segment S1.79 of Supplement 1 (online), will be helpful.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here