






































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Acharya; Class: Data Structures; Subject: CSCI Computer Science; University: Georgia Southern University; Term: Fall 2009;
Typology: Study notes
1 / 46
This page cannot be seen from the preview
Don't miss anything!







































Stack
A stack
Stack of cafeteria dishes
Operations in Stack
Operations in Stack
Operations in Stack
Stack Implementation The Java Collections Framework includes a set of ready made data structure classes, including a Stack class. However, we will create our own stack class order to learn how a stack is implemented. Our class will be a bit simpler than the Collections Framework.
Stack Implementation
(^) a static data structure
(^) a dynamic data structure
(^) These define collections of data which are fixed in size when the program is compiled. An array is a static data structure.
(^) These define collections of data which are variable in size and structure. They are created as the program executes, and grow and shrink to accommodate the data being stored.
Stack Implementation
Stack Implementation
Stack Implementation
A stack can be used to verify whether a program contains balanced braces
Checking for Balanced Braces Traces of the algorithm that checks for balanced braces
Implementation of the stack that use a) an array; b) a linked list;