CS200: Introduction to Algorithms
CS200 Lab 1
CS200 Lab 1, Using a Stack to create a palindrome
Overview
The goals of this lab are as follows:
- Change a recursive implementation of a palindrome generator to using a stack
Palindrome Implementation
- Create Project R1 in eclipse and put Palindrome.java and Stack.java in the src directory of your project folder.
- The palindrome generator appends the reverse of a string to the string.
Your TA will go over both of these Classes.
- Implement the Pop, Peek and Push methods of Stack.java (Remember a Stack is First in Last out).
- Modify Palindrome.java to use Stack.java as opposed to recursion in order to produce palindromes.