Skip to main content
Contents
Dark Mode Prev Up Next Scratch ActiveCode Profile
\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 5.7 Summary and Reading Questions
A statically allocated C++ array is an ordered collection of one or more C++ data values of identical type stored in contiguous memory.
A vector is a dynamically allocated array with many useful methods. It is more similar to the Python list than the array.
C++ strings are a sequential collection of zero or more characters. They are very similar to Python strings.
A hash table is used to store keys-value pairs. It applies a related hash function to the key in order to compute the location of the associated value. Look-up is typically very fast.
A set is an unordered collection of unique values.
Reading Questions Reading Questions
1.
Which C++ structure is the best choice for a group of ordered data of a fixed length?
Correct!
No. hash tables are not ordered.
A string would only work for character data. Try again.
There is a better choice given that the group is fixed length.
more than one of the above
Only of the above is best.
2.
3.
4.
You have attempted
of
activities on this page.