Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Coding exercise 1 - Implement a stack using arrays Create a template called arrayStack that implements a stack using an array in a file
C++
Coding exercise 1 - Implement a stack using arrays Create a template called arrayStack that implements a stack using an array in a file called arrayStack.h. The template should have the functionalities of push, pop, top, size, maxSize, and empty as described in the lecture. Coding exercise 2 - Implement the algorithm to convert an expression from infix to postfix using your array stack The algorithm to convert from infix expression to postfix expression is available in the textbook. A handout is also included with this assignment that contains the pseudocode for the algorithm. I do not encourage directly using the algorithm without attempting to write it out yourself first. Name your source file myInfixPostfix. cpp. Assume that you only have operators +, -, *,/. Test cases you can use: A +B - C; A((BC (E -F) - G)/(H -l); A+B* (CD) - E/F G+H; Coding exercise 3 - Implement the algorithm to convert an expression from infix to postfix using the STL stack Replace the stack implementation in your code to convert from infix expression to postfix expression with the STL stack implementation. The reference for the STL template is here. Name your source file stlInfixPostfix. cpp. To avoid multiple definitions of main errors, name your functions myInfixPostfix and stlInfixPostfix In myInfixPostfix.cpp and stlInfixPostfix.cpp. Create two additional header files myInfixPostfix.h and stlInfixPostfix.h that contain the prototypes of the functions and a main.cpp file that includes those headers and calls the infixPstfix functions as necessary Coding exercise 1 - Implement a stack using arrays Create a template called arrayStack that implements a stack using an array in a file called arrayStack.h. The template should have the functionalities of push, pop, top, size, maxSize, and empty as described in the lecture. Coding exercise 2 - Implement the algorithm to convert an expression from infix to postfix using your array stack The algorithm to convert from infix expression to postfix expression is available in the textbook. A handout is also included with this assignment that contains the pseudocode for the algorithm. I do not encourage directly using the algorithm without attempting to write it out yourself first. Name your source file myInfixPostfix. cpp. Assume that you only have operators +, -, *,/. Test cases you can use: A +B - C; A((BC (E -F) - G)/(H -l); A+B* (CD) - E/F G+H; Coding exercise 3 - Implement the algorithm to convert an expression from infix to postfix using the STL stack Replace the stack implementation in your code to convert from infix expression to postfix expression with the STL stack implementation. The reference for the STL template is here. Name your source file stlInfixPostfix. cpp. To avoid multiple definitions of main errors, name your functions myInfixPostfix and stlInfixPostfix In myInfixPostfix.cpp and stlInfixPostfix.cpp. Create two additional header files myInfixPostfix.h and stlInfixPostfix.h that contain the prototypes of the functions and a main.cpp file that includes those headers and calls the infixPstfix functions as necessaryStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started