STL Container Classes vs Data Structures





vector & Arrays





list





set: Balanced Binary Search Tree





map





hash_map





Running Times

For n random insertions and finds (?? = projected):

n = 10,000 20,000 200,000 400,000
vector 35.827 143.747 4 hrs?? 16 hrs??
sorted vector 9.046 36.336 1 hr?? 4 hrs??
list 24.065 97.952 2.7 hrs?? 10.9 hrs??
sorted list 30.223 125.181 3.5 hrs?? 14 hrs??
set 0.108 0.232 3.312 7.347
map 0.146 0.312 4.286 9.376
hash_map 0.085 0.168 2.345 4.891




Types of Iterators