Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is in C++ and the 3 exercises are all a part of one assignment Coding exercise 1 - Implement a stack using arrays Create

this is in C++ and the 3 exercises are all a part of one assignmentimage text in transcribed

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+,,.,1 Test cases you can use: A+ B-C (A+B) C (AB) (C-D); A((BC) (E-F) -G)/(H-D; A+B (C+D)-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 myInfixPostfixand 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+,,.,1 Test cases you can use: A+ B-C (A+B) C (AB) (C-D); A((BC) (E-F) -G)/(H-D; A+B (C+D)-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 myInfixPostfixand 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions