Question: Sublists and concatenation (Python) Add the following functionality to your class (this will only be tested with integer values). sublist(self, start, length) Returns a new

Sublists and concatenation (Python)

Add the following functionality to your class (this will only be tested with integer values).

sublist(self, start, length)

Returns a new ArrayList with values from self

First value at start

length is the number of values copied

If start and length would go outside current list, raise IndexOutOfBounds()

concatenate(self, other)

Returns a new ArrayList with values from self and other

All the values from self

Followed by all the values from other

Bonus if both these operations are implemented recursively and without unnecessary copying of data

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!