CS 162 Lecture Notes - Lecture 21: Standard Template Library, Abstract Data Type, Priority Queue
CS 162 – Lecture 21 – Standard Template Library
Standard Template Library
o Collection of common abstract data types
o When found in the STL, abstract data type == container classes
o Data Structure: a particular way of storing and organizing data
▪ Array, Linked List, Trees
o Abstract Data Type: the rules that govern how data is accessed
▪ Stack
• Last in, first out
▪ Queue
• First in, first out
▪ Priority Queue
• Highest priority out first
Types of Containers
o Sequential
▪ Arrange data items into a list such that there is a first, next, and so on up
to last
o Adapters
▪ Implemented on top of other classes
• Abstract data types
o Associative
▪ Very simple databases
• Set, map
Iterators
o A construct that allow you to cycle through the data items stored in a data
structure
o Generalization of a pointer
▪ Typially ipleeted as a poiter ut is astrated so e do’t hae to
deal with it
find more resources at oneclass.com
find more resources at oneclass.com