Lecture 25: Standard Template Library
Tuesday 05/08, 2007
[Up]
[Previous Lecture]
[Next Lecture]
Assigned Reading:
Slides As Shown:
Topics Covered:
- Announced revised midterm/final exam grading policy.
See announcement slides.
- Continued discussion of binary search trees.
- Discussed hash tables. Used
data
structure visualization tool to compare open vs closed hashing.
- Discussed the STL container classes vector, list, set, map and
hash_map:
vector1.cpp,
svector1.cpp,
list1.cpp,
slist1.cpp,
set1.cpp,
map1.cpp and
hash_map1.cpp.
- Performed timing runs on these data structures on random
data with 10,000, 20,000, 200,000 and 400,000 elements:
vector2.cpp,
svector2.cpp,
list2.cpp,
slist2.cpp,
set2.cpp,
map2.cpp and
hash_map2.cpp.
- The conclusion is that the choice of data structure can
have a drastic effect on the running time of a program.
- Asked students to think about the 7 pirates and 65 gold pieces
problem for Thursday. Think recursively!