Question: What would be wrong with modifying the UnsortedType class as follows? private: ItemType * info; // CHANGE: make the array a pointer int length; //

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 lgth) { // CHANGE: pass in array info = vals; length = lgth; } // leave rest alone 
a.

The constructor should allocate a new array and copy the elements of the parameter into this new array

b.

The new version of UnsortedType is fine

c.

the array parameter to the constructor might have fewer than 5 elements

d.

info should still be an array instead of a pointer

Your company makes a personal health app and wants to test it with different kinds of people to see that it works out for them. The company has decided to classify people along the following dimensions: age, diet, exercise habits. There are A groups when divided by age, D groups when divided by diet, and E groups when divided by exercise habits. What is the big O in terms of the minimum number of people you need to cover all possibilities?

a.

O(1)

b.

O(2A*D*E)

c.

O(A+D+E)

d.

O(A*D*E)

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!