CSc 7003, Programming for Data Science (Summer 2021)
Program 6 - Stacks
Complete the methods in the following files:
Sample runs of the two driver programs are shown below:Reverse
$ python3 Reverse.py input a string (q to quit): abcdef reverse of string: fedcba input a string (q to quit): madam reverse of string: madam input a string (q to quit): q
Matching Parentheses
$ python3 MatchingParen.py Enter string (q to quit): {([])} BALANCED Enter string (q to quit): ()[]([]) BALANCED Enter string (q to quit): ()) NOT BALANCED Enter string (q to quit): ((]] NOT BALANCED Enter string (q to quit): q