CIS 2500 Lecture 10: CIS2500 Lecture 10
Document Summary
Representation stacks and queues can be built using either linked lists of sequential memory arrays the list representation requires dynamically allocated structures to be added/removed. Linked representation removing a stack element -> take an element from the head. Sequential representation: stack stackis easy to represent as an array there is nodefined representation just a stack of values. Add element 4 by writing element to index (i) 5 and setting head to 5. A queue is harder to implement than a stack it continues to grow in one direction and will eventually reach the end of the array remove head from the end and put new integer within. A collection of data structures, variables and functions that operate on them formally, a methmatical entity with some operations that may be performed on it. We want to separate the data structure from the details of its implementation.