next up previous
Next: Implement your own stack Up: Assignment 5: Stacks Previous: Implement split

Check balance and nesting

  1. Write a program called Balance.java that reads a file and checks that the parentheses () and brackets [] and squiggly-braces {} are balanced and nested correctly.

    You can use the file I/O code from the previous assignment, and you can use Java's built-in implementation of a Stack.



Allen Downey
Tue Oct 10 15:33:10 EDT 2000