Compare and contrast vectors and arrays.
What will be an ideal response?
Vectors have many built in features that help track the number of elements as well as provide memory management capabilities. A corresponding array structure would require you to write much of your own code to accomplish the same tasks. The biggest advantage of vectors over arrays is the capability to increase and decrease size as necessary. Arrays have a fixed size.
Arrays do not carry the restrictions on base type that vectors impose. The base type of an array can be of any type; the base type of a Vector is always of type Object. Therefore, storing primitive values requires a little more work because the appropriate wrapper class needs to be used.
You might also like to view...
Which component of the SQL Server database engine builds a physical execution plan from a SQL query?
A. query optimizer B. query editor C. query execution planner D. query processor
New LCDs (and video cards) sport fully digital connections, the most common of which is the _______________ standard.
Fill in the blank(s) with the appropriate word(s).