Vectors can be accessed like arrays using the a. Class Vector inherit the class
ID: 3606176 • Letter: V
Question
Vectors can be accessed like arrays using the a. Class Vector inherit the class array b. They are both essentially the same data structure c. They both are able to have default arguments d. Because the clas opera tion because index s vector overloads the D operator to return the value at the requested Q9: When a vector is implemented using an array: a. We cannot expand the size of the vector. b. We can only use it to store integers. c. Never possible. thewarray of larger size needs to be created in order to dynamically change the size Q10: An iterator is implemented for some containers in Ct+ to a. b. c. d. Allow client class to access To change the address where data is stored in the container To query the size of the container To access individual elements of the container and to navigate thróugh the container s private variables of the container directly Q11: STL List and Vector provide return the lterator placed at the first element in the container by using the: a. Head pointer b. Iterator) function c. Start() function d. begin() function Q12: The Sequence container can be used as both an array and a List because It inherits the List class. a. b. It contains an array It always keeps its data sorted d. c. It provides functions that allow access to elements both by position and by index Q13: Each pass in a bubble sort algorithm: a. Places the largest element in a separate sequence b. Splits the sequence in two equal parts c. Places the median element in the middle d. Moves the largest element in its correct position in the sequence Q14: A general tree can have: a. More than one roots. b. Nodes that have two parents. c. External nodes that have children d. Nodes with any number of children a. the number of leaves on the tree b. list of all the root's children c. the number of descendants it has d. zero Q15: The depth of the root in a general tree is:Explanation / Answer
Answer 8
(d) Because the class vector overloads the [] operator to return value at the requested index.
Answer 9
(d) A new array of larger size needs to be created in order to dynamically change the size of the vector
Answer 10
(d) To access the individual elements of the container and to navigate through the container
Example: map<int,string> :: iterator i;
Answer 11
(d) begin() function of the iterator can be used
Answer 12
(d) It provides functions that allow access to elements both by position and by index
Answer 13
(d) Moves the largest element in its correct position in the sequence
Answer 14
(d) Nodes with any number of children
Answer 15
(d) zero (since root is at top of tree, depth=0)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.