standard template library bryce boe 2013/08/20 cs24, summer 2013 c
TRANSCRIPT
![Page 1: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/1.jpg)
Standard Template Library
Bryce Boe2013/08/20
CS24, Summer 2013 C
![Page 2: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/2.jpg)
Outline
• Lab 7 Solution• Project 2 Solution• Project 3 Overview• Extra Credit Assignment• C++ Standard Template Library (STL)
![Page 3: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/3.jpg)
Lab 7
• Verify whether or not an array is in heap-order• Idea 1: For each node verify its children (if
present) are not larger• Idea 2: For each node verify its parent is not
smaller• <In class look at my solution>
![Page 4: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/4.jpg)
Project 2 Solution
• <In class look at my solution>
![Page 5: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/5.jpg)
Project 3 Overview
• Concept: Hospital emergency room log• Logs when (1) patients arrive, (2) patients are
visited by a doctor, and (3) when patients leave
![Page 6: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/6.jpg)
Input File
# Priorities01 Cough10 Bleeding# DoctorsDr. Doctor# Patient Arrivals08:00 “Patient A” “Head ache” 2508:00 “Patient B” “Bleeding” 60
![Page 7: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/7.jpg)
Output File
08:00 Patient A arrives08:00 Patient B arrives08:00 Dr. Doctor visits Patient B about Bleeding09:00 Patient B departs09:00 Dr. Doctor visits Patient A about Head ache09:25 Patient A departs
![Page 8: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/8.jpg)
Data Structures to Use
• Queue– Patient arrivals– Available doctors
• MaxHeap– Patients who are waiting to see a doctor– Patients who are currently seeing a doctor
• Hash Table– Mapping of symptom to priority
![Page 9: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/9.jpg)
Extra Credit Assignment
• 1024+ word reflection essay• How has this course made an impact (can be
both positive and negative) on you?• Writing about what you directly learned will
not be sufficient• Due by class next Tuesday
![Page 10: Standard Template Library Bryce Boe 2013/08/20 CS24, Summer 2013 C](https://reader036.vdocument.in/reader036/viewer/2022082709/56649f515503460f94c74dbf/html5/thumbnails/10.jpg)
C++ Standard Template Library
• algorithm• vector• queue• unordered_map (tomorrow’s lab)