Question
I need help with understanding my c++ hw. Its about stl containers We are going to dive deep into a few of the stl containers
I need help with understanding my c++ hw. Its about stl containers
We are going to dive deep into a few of the stl containers because it is cool. But in real life the whole point of stl is to keep you from having to write them yourselves. So the first data structure homework is about using stl.
List, Vector, Stack, Queue, Set, Map, UnorderedMap, PriorityQueue
-Make a Student class that has Name, GPA, and StudentDebt as properties
-In main, make a List of ints. Add some numbers to it
-Make a Vector of Students. Add some Student objects to it
-Make a Stack of Student Pointers. Push and pop some dynamically created Students to it. Make sure you don't leak memory
-Make a Set of ints. Add some numbers to it
-Make a Map of strings to ints. Put some movie titles and the year they cam out in it
-Do the one above with an unordered map
And then the hard ones
-Make a priority queue that uses a Student's GPA for the sort criteria. Add some Student objects and show that the next one popped is the highest GPA
-Make a priority queue that uses a Student's Debt for the sort criteria. Add some Student pointers for dynamically created Students and show the next one popped is the one with the least debt.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started