Write a stack client

  

Write a stack client Brackets.java  that reads in sequence of left and right parentheses, braces, and brackets from standard input and uses a stack to determine whether the sequence is properly balanced. 

For example, your program should print true for [()]{}{[()()]()} (Brackets1.txt)

and false for [(]) (Brackets2.txt). These input files are in Code,Documents.

Your calling statement should be: java Brackets < Brackets1.txt or 

java Brackets < Brackets2.txt. Run both input files.  

use the program WeightedQuickUnionUF.java and again use the file “Assn2and3” as input. Modify the program to count the actual number of array accesses with a variable – disregard the array initialization. Submit a .txt file of the program with the results at the end.

Tags: No tags