CMPSCI 187: Programming With Data Structures

David Mix Barrington

Fall, 2012

Discussion Assignment #3: Sorting With Two Stacks

19 September 2012

The goal of this activity was for each pair of students to:

  1. Use a text file and some code from outside
  2. Use the StringBag data structure from Project #1
  3. Use two stacks to sort a collection of Strings
  4. Find the 1000th, 2000th, 3000th, 4000th, and 5000th string in the given text file, according to alphabetical order.

The handout from class is here. Here is a solution written by Ravali.

This discussion wasn't very successful because I asked you to do too much, particularly given the problems with the EdLab machines. This would have been a better Discussion #4.

The file of five-letter words can be found on the web here.

Last modified 26 September 2011