Question: You are to write a program in either c or c++. Your program should prompt the user for a string of symbols, including: brackets

You are to write a program in either c or c++. Your program should prompt the user for a string of symbols, including: brackets ']', '[', curly brackets '{', '}', and parentheses '(',')'. After reading in the string of symbols, your code should push each symbol onto the stack. Once all symbols have been pushed onto the stack, your code should use your pop function to remove each element from the stack. Your code should print each element after it has been removed from the stack. For example, if the user enters: '({})', your program should produce the following output. ) } { ( The requirements of the assignment are: Your program should be implemented in either C or C++. You are to implement your own stack functions, including push() and pop(). You must use a linked list to implement your stack. Do not use pre-defined lists classes or modules. You can use a basic struct to create a node for your linked list data structure: Please see the example below: struct Node { char symbol; Node *next; }
Step by Step Solution
There are 3 Steps involved in it
cpp include iostream struct Node char data Node next class Stack pr... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
663d5331a9544_967981.pdf
180 KBs PDF File
663d5331a9544_967981.docx
120 KBs Word File
