What is the difference between a vector’s size and a vector’s capacity?

What will be an ideal response?


A vector’s size refers to the actual number of elements with values in the vector, whereas the vector’s capacity refers to the total number of memory locations reserved for the vector’s use.

Computer Science & Information Technology

You might also like to view...

Given an array named scores with 25 elements, what is the correct way to access the 25th element?

a. scores+25 b. scores[24] c. scores[25] d. scores[last]

Computer Science & Information Technology

Answer the following statements true (T) or false (F)

1. Arrays can hold only data of primitive types. 2. In an array of Boolean variables, if the initializer list is empty, the elements in the array are initialized to the default value True. 3. The declaration and allocation of an array can be combined into one statement. 4. Visual Basic can determine the array bounds from the number of elements in the initializer list. 5. Array method GetUpperBound returns the index of the last element in an array. The value returned by method GetUpperBound is one less than the value of the array’s Length property.

Computer Science & Information Technology

Which of the following is an important consideration when evaluating storage options for digital devices?

A. Durability B. Dependability C. Capacity D. All of the above

Computer Science & Information Technology

What is the decimal equivalent of the binary number 11000001?

A. 128 B. 164 C. 193 D. 201

Computer Science & Information Technology