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:

Palindrome Implementation

  1. Create Project R1 in eclipse and put Palindrome.java and Stack.java in the src directory of your project folder.
  2. The palindrome generator appends the reverse of a string to the string. Your TA will go over both of these Classes.
  3. Implement the Pop, Peek and Push methods of Stack.java (Remember a Stack is First in Last out).
  4. Modify Palindrome.java to use Stack.java as opposed to recursion in order to produce palindromes.