wsconnors / Rotate-Array-Pt1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rotate-Array-Pt1

Objectives

  1. To demonstrate your understanding of objects and functions
  2. To demonstrate your understanding of controlling execution
  3. To demonstrate your understanding of access control
  4. To demonstrate your understanding of reusing classes

Overview

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?

Unit Test

No Unit Test

Instructions

  1. In your main class, initialize your custom List with values
  2. In your main class call the method that rotates your array
  3. Print original and rotated List values to screen

About