Consider a new ADT named AltListADT which has the same metho

Consider a new ADT named AltListADT which has the same methods as the ListADT and one additional method:

Instead of myList.get(pos), a programmer could access an entire range of items in this manner:

The array that is returned would have copies of the String items that were at index 3,4,5,6 (the item at index 7 would not be returned). However, they would now be in an array with length equal to 4, and the items would be at indexes 0,1,2,3.

Is this a \"good\" addition to the list ADT? Choose all statements that are true.

1) This increases the reusability of the ListADT

2) This is not okay. Must not have two interfaces that have the same methods except for one.

3) This reduces the generality of the ListADT

4) This improves the efficiency as the application program would not have to call the get method multiple times to get the items within a range of values.

5) This increases the complexity as now programmers must choose between ListADT and AltListADT.

1) This increases the reusability of the ListADT

Solution


Same functionality can be achieved from ListADT by calling multiple times \'get\' methods in a loop.
Time complexity will be same. So, this is not any kind of improvement from time complexity point.

True options are:
   2) This is not okay. Must not have two interfaces that have the same methods except for one.
   4) This improves the efficiency as the application program would not have to call the get method multiple times to get the items within a range of values.
   5) This increases the complexity as now programmers must choose between ListADT and AltListADT.
  

Consider a new ADT named AltListADT which has the same methods as the ListADT and one additional method: Instead of myList.get(pos), a programmer could access a

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site