CMPS 260: Data Structures
Stacks are another classical data structure and follow the last in first out principle. For example, when creating a stack of books the last one that goes on top is also the first one to come off again. Instead of saying add and remove (as we do with arrays) we say push and pop in case of stacks. A big difference between arrays and stacks is that elements on a stack are not retrieved by index. One operation that is common is to peek at the top element without removing it. We will look at some problems that use stacks, such as converting decimal numbers to binary.
- Implement and use the stack data structure
- Solve problems using stacks
- Module 3 Readings: Chapter 3 (skip ECMAScript sections)
- Module 3 Slides: Chapter 3
- Module 3 Assignment