MCQsAdvanced MCQsVectors and Dynamic ArraysVectors and Dynamic Arrays 1).What is the main advantage of using a vector in C++ over an array?1) Dynamic resizing2) Fixed size3) Faster access time4) None of the above 2).Which of the following methods adds an element to the end of a vector?1) push_back()2) append()3) insert()4) add() 3).How can you initialize a vector with predefined values?1) vector<int> v(5, 10);2) vector<int> v = {10, 20, 30};3) vector<int> v(5);4) All of the above 4).What does the 'resize' method of a vector do?1) Changes the size of the vector2) Sorts the vector3) Removes all elements4) None of the above 5).Which of the following is a drawback of using vectors?1) Increased memory consumption2) Slow resizing performance3) No random access4) None of the above 6).Can a vector hold elements of different data types?1) Yes, by using void pointers2) No3) Yes, by using a template4) None of the above 7).What is the time complexity of accessing an element in a vector?1) O(1)2) O(n)3) O(log n)4) O(n^2) 8).How do you remove the last element from a vector?1) pop_back()2) erase()3) remove()4) delete() 9).Which operation is NOT supported by a vector?1) Accessing elements by index2) Inserting elements in the middle3) Random access to elements4) None of the above 10).What is the capacity of a vector?1) The number of elements it can currently hold2) The maximum number of elements it can ever hold3) The amount of memory allocated for the vector4) None of the above