Questions
- Replace your template
Array
class from your exercise from Chapter 13, Working with Templates, with an STLvector
. Create avector
ofStudent
instances. Usevector
operations to insert, retrieve, print, compare, and remove objects from the vector. Alternatively, utilize an STLlist
. Use this opportunity to utilize the STL documentation to navigate the full set of operations available for these classes.
a. Consider what operators, if any, you will need to overload. Consider whether you will need an iterator
to provide safe interleaved access to your collection.
b. Create a second vector
of Student
instances. Assign one to another. Print both vectors.
- Modify the
map
from this chapter to index the hash table (map) ofStudent
instances based onlastName
rather thanstudentId
. - Modify the
queue
example from this chapter to instead utilizepriority_queue
. Be sure to make use of the priority enqueueing mechanismpriority_queue::emplace()
to add elements...