order of popping is the order in the output if the current input token is '('push it onto the stack if the current input token is ')'pop off all operators and append them to the output string until '(is poppeddiscard the '( if the end of the input string is foundpop all operators and append them to the output string this algorithm doesn' handle errors in the inputalthough careful analysis of parenthesis or lack of parenthesis could point to such error determination apply the algorithm to the above expressions backtracking backtracking is used in algorithms in which there are steps along some path (statefrom some starting point to some goal find your way through maze find path from one point in graph (roadmapto another point play game in which there are moves to be made (checkerschessin all of these casesthere are choices to be made among number of options we need some way to remember these decision points in case we want/need to come back and try the alternative consider the maze at point where choice is madewe may discover that the choice leads to dead-end we want to retrace back to that decision point and then try the other (nextalternative againstacks can be used as part of the solution recursion is anothertypically more favoredsolutionwhich is actually implemented by stack memory management any modern computer environment uses stack as the primary memory management model for running program whether it' native code ( sunvaxor jvma stack is at the center of the run-time environment for javac++adafortranetc the discussion of jvm in the text is consistent with ntsolarisvmsunix runtime environments each program that is running in computer system has its own memory allocation containing the typical layout as shown below