Question: QUESTION 10 What would be wrong with modifying the UnsortedType class as follows? private: ItemType.info; // CHANGE: make the array a pointer int length; //
QUESTION 10 What would be wrong with modifying the UnsortedType class as follows? private: ItemType.info; // CHANGE: make the array a pointer int length; // rest of fields are unchanged from the current version of the code public: UnsortedType (ItemType *vals, int Igth) { // CHANGE: pass in array info = vals; length = lgth: // leave rest alone a. info should still be an array instead of a pointer b. The constructor should allocate a new array and copy the elements of the parameter into this new array Oc. The new version of UnsortedType is fine Od the array parameter to the constructor might have fewer than 5 elements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
