CMPSC 24 Chapter 7: Chapter 7 Stacks

40 views2 pages
3 Mar 2017
School
Course
Professor

Document Summary

Stack = an ordered collection of entries that can be accessed at only one end. Top = the end from which items can be removed. Last-in/first-out (lifo) = entries are taken out of the stack in the reverse order of their insertion. Push operation = adding an entry to a stack. Pop operation = removing an entry from a stack. C++ standard template library (stl) has a stack class specified as a template class. Top = get the item at the top of the stack without removing it. Stack underflow = when a program attempts to pop an item off an empty stack. Stack overflow = when a program attempts to push an item onto a full stack. Scan characters of the string from left to right. Every time the function sees a left parenthesis, it is pushed onto the stack. Every time the program reads a right parenthesis, it pops a matching left parenthesis off 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