diff --git a/Reusing_Classes_Labs b/Reusing_Classes_Labs new file mode 160000 index 0000000..d82ae4f --- /dev/null +++ b/Reusing_Classes_Labs @@ -0,0 +1 @@ +Subproject commit d82ae4f16e5abbfc9629b602547dd4d22e216f12 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..64e2cae --- /dev/null +++ b/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + reynoldstitko.gillian + RotatingArrays + 1.0-SNAPSHOT + + + + + junit + junit + 4.12 + + + + + \ No newline at end of file diff --git a/src/main/java/reynoldstitko/gillian/RotateArrays.java b/src/main/java/reynoldstitko/gillian/RotateArrays.java new file mode 100644 index 0000000..91ea2a5 --- /dev/null +++ b/src/main/java/reynoldstitko/gillian/RotateArrays.java @@ -0,0 +1,50 @@ +package reynoldstitko.gillian; + +import java.util.ArrayList; +import java.util.*; + +/** + * Created by gillianreynolds-titko on 1/18/17. + */ +public class RotateArrays extends ArrayList { + + public void rotateArray(ArrayList inputArray, int k){ + System.out.println("Your input array is: "+ inputArray); + if(k > inputArray.size()){ + System.out.print("Choose k less than or equal to your array size"); + return; + } + + for(int i=0; i