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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started