COMS W3134 Lecture Notes - Lecture 9: Operand, Pyramid Scheme
Document Summary
Announcements: grade change request for hw1 due by next thursday, won"t cover all of chapter 4, only up to 4. 4. Infix to postfix conversion (stack application: scan through token by token, when encounter operand, output it, when encounter an operator, if stack empty push onto stack. If stack not empty, then need to determine if those other operators need to happen before this one. Look at operator at top of stack, if has lower precedence, then push operator onto stack. If see open parentheses in stack, then keep it in stack until the closed parentheses is found. When they are both found then pop all operators in between parentheses and remove the open and close parentheses and move on. Final output: a b c * + d e * f + g * : method calls/recursion (stack application, method calls another method, when calling a second time, it gets new variables.