COMP 250 Lecture Notes - Lecture 17: Web Browser, Text Editor, Program Counter

49 views2 pages

Document Summary

List that allows only operations at one end of the list (called the top) Can be implemented in an efficient matter. Many problems can be solved using stacks. Direct applications: page-visited history in a web browser, undo sequence in a text editor, chain of method calls in the java virtual machine (program running in the background of your computer, that executes your program) Indirect applications: auxiliary data structure for algorithms, component of other data structures. The jvm keeps track of the chain of active methods with a stack. When a method is called, the jvm pushes on the stack a frame containing: local variables and return value, program counter, keeping track of the statement being executed. When method ends, its frame is popped from the stack and control is passed to the method on top of the stack. An integer top keeps track of the top of the stop. Capacity fixes the size of the array, hence the stack.

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