stack source

Click Here to Download this Answer Instantly

Write a stack client  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.

use the program 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.