FlashKeepers

C and C++ · College · College and University

C++ IV: The STL

STL containers, iterators, algorithms, lambdas with algorithms, complexity guarantees and ranges.

About this set

39 basic cards for College C and C++. Set 4 of 7 in C++. It opens with "What is the most versatile STL container for most use cases?" and "Which container supports O(1) insertion and deletion at both ends?". Study it alongside the other College sets below.

39 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is the most versatile STL container for most use cases?
Show answervector
Which container supports O(1) insertion and deletion at both ends?
Show answerdeque
What is the key difference between std::list and std::vector?
Show answerlist is a linked list, vector is a dynamic array
When should you use std::set instead of std::vector?
Show answerwhen you need unique sorted elements with O(log n) insertion, deletion, and lookup
What does std::map store?
Show answersorted key-value pairs
What is the difference between std::map and std::unordered_map?
Show answermap uses a tree (sorted), unordered_map uses a hash table
What is std::forward_list?
Show answera singly-linked list container
Name the three STL container adapters.
Show answerstack, queue, priority_queue
What is std::array?
Show answera fixed-size array wrapper that provides STL-compatible semantics
What are the five iterator categories in C++?
Show answerinput, output, forward, bidirectional, random access
Which STL containers support random-access iterators?
Show answervector, deque, array, string
What operations does a forward iterator support?
Show answerincrement (++), dereference (*), and equality comparison (==)
What operations does a bidirectional iterator support?
Show answerincrement (++), decrement (--), dereference (*), and equality comparison (==)
What does iterator invalidation mean?
Show answeran iterator no longer refers to a valid element in a container
After which operations can std::vector iterators become invalid?
Show answerafter reallocation (push_back causing growth), erase, or clear

24 more cards in the app

Study this set free