COMS W3134 Lecture Notes - Lecture 9: Operand, Pyramid Scheme

42 views2 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents