Creates an array to be used as stack for storing values.
int stackTop
Represents the index of the last value added to array. -1 means array is empty.
Functions for Postfix Expression algorithm.
void evaluate(float a, float b, const std::string &operation, Stack *stack)
Evaluate answer using given last two operands from and operation.
static void test_function_2()
Test function 2 with input array {'1', '2', '+', '2', '/', '5', '*', '7', '+'}.
static void test_function_1()
Test function 1 with input array {'2', '3', '1', '*', '+', '9', '-'}.
void push(float operand, Stack *stack)
Pushing operand, also called the number in the array to the stack.
float postfix_evaluation(std::array< std::string, N > input)
Postfix Evaluation algorithm to compute the value from given input array.