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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!