Unit 6
STL Components
Heap
STL Components
1. Container collection of objects of different types. Can be implemented using
template classes. 2 types - sequence(vector, dequeue, list bidirectional)and
associative(set, multiset, map, multimap)
a. Classes that are derived from sequence containers are called container
adapters(stack, queue, priority queue,
2. Iterator basically objects but sometimes they can be pointers. They specify the
position in the container
3. Algorithm process contents of containers.
a. Sorting
b. Mutating Sequence
c. Non mutating sequence
d. Numerical
Heap
Heap is a complete binary tree or an almost complete binary tree
Max heap is a tree where each value of a node is greater than or equal to the value of
its children
Min heap is a tree where each value of a node is less than or equal to the value of its
children
Unit 6 1
Unit 6
STL Components
Heap
STL Components
1. Container collection of objects of different types. Can be implemented using
template classes. 2 types - sequence(vector, dequeue, list bidirectional)and
associative(set, multiset, map, multimap)
a. Classes that are derived from sequence containers are called container
adapters(stack, queue, priority queue,
2. Iterator basically objects but sometimes they can be pointers. They specify the
position in the container
3. Algorithm process contents of containers.
a. Sorting
b. Mutating Sequence
c. Non mutating sequence
d. Numerical
Heap
Heap is a complete binary tree or an almost complete binary tree
Max heap is a tree where each value of a node is greater than or equal to the value of
its children
Min heap is a tree where each value of a node is less than or equal to the value of its
children
Unit 6 1