CPE 102 Chapter Notes - Chapter 3.1-3.7, 4.6: Reverse Polish Notation, Call Stack

40 views2 pages

Document Summary

Linear data structures are collections of items ordered depended on how they are added or subtracted. A stack is an ordered collection of items where addition of new items and removal of existing items always occurs on the same end. Stacks can be used to reverse order of items. Push(item) adds a new item at the top of the stack. Pop() removes the top item from the stack. Peek() returns the top item from the stack and does not remove it. Isempty() tests to see if a stack is empty, and returns a boolean. Size() returns the number of items on the stack. All operations done on a stack are done with . followed by the command. We can use stacks to connect sets of information and data. Stacks are how recursive functions are carried out. When there are recursive calls in python, it creates a stack frame for the 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 textbook solutions

Related Documents