Here is another illustration of the aforementioned method: Input string: "3*(2+2)-6" Output: 6 Below is a concise explanation of this example: Read "3"; since it's a number, add it to the values stack. Read "*"; being an operator, add it to the operators stack. Read "(", which is also an operator, and push it onto the operators stack. Read "2"; it's a number, so push it to the values stack. Read "+"; as an operator, push it to the operators stack. Read "2"; push this number onto the values stack as well. Read ")"; as this is a closing bracket, we first evaluate the expression within the brackets, "2+2", and push the result "4" onto the values stack. Read "-"; this is an operator. Now, we solve the remaining operations within the parentheses, "3*4", which gives us "12", and we push this result to the values stack. Then, we add "-" to the operators stack. Read "6"; push this number to the values stack. Now that the entire string has been parsed, we proceed to evaluate the remaining operations in the stack, "12-6". Ultimately, this results in "6".