- To demonstrate your understanding of objects and functions
- To demonstrate your understanding of controlling execution
- To demonstrate your understanding of access control
- To demonstrate your understanding of reusing classes
Create a class that subclasses the built-in List class. Write a function that rotates a list by k elements. For example [1,2,3,4,5,6] rotated by two becomes [3,4,5,6,1,2]. Try solving this without creating a copy of the list. How many swap or move operations do you need?
No Unit Test
- In your main class, initialize your custom List with values
- In your main class call the method that rotates your array
- Print original and rotated List values to screen