From 34681251bcbb698ac3cc6b3a35e008512fcf8c98 Mon Sep 17 00:00:00 2001 From: Alfatih Mukhtar Date: Wed, 18 Jan 2017 18:51:04 -0500 Subject: [PATCH 1/2] One down three to go --- src/main/java/ReusingClasses/App.java | 7 ++++ .../ReusingClasses/ArrayRotationHandler.java | 39 +++++++++++++++++++ src/main/java/ReusingClasses/List.java | 9 +++++ .../ArrayRotationHandlerTest.java | 26 +++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 src/main/java/ReusingClasses/App.java create mode 100644 src/main/java/ReusingClasses/ArrayRotationHandler.java create mode 100644 src/main/java/ReusingClasses/List.java create mode 100644 src/test/java/ResusingClassesSpec/ArrayRotationHandlerTest.java diff --git a/src/main/java/ReusingClasses/App.java b/src/main/java/ReusingClasses/App.java new file mode 100644 index 0000000..dd4ab75 --- /dev/null +++ b/src/main/java/ReusingClasses/App.java @@ -0,0 +1,7 @@ +package ReusingClasses; + +/** + * Created by alfatihmukhtar on 1/18/17. + */ +public class App { +} diff --git a/src/main/java/ReusingClasses/ArrayRotationHandler.java b/src/main/java/ReusingClasses/ArrayRotationHandler.java new file mode 100644 index 0000000..4e560d9 --- /dev/null +++ b/src/main/java/ReusingClasses/ArrayRotationHandler.java @@ -0,0 +1,39 @@ +package ReusingClasses; + +import java.util.Arrays; + +/** + * Created by alfatihmukhtar on 1/18/17. + */ +public class ArrayRotationHandler { + // take in factor "x" to rotate by + // rotate every item in array by "x" places + + // create method that takes two arguments (array, k) where k = number of elements to rotate. + public int[] rotateArray(int[] array, int rotation) { +// System.out.print("The initial array is: "); +// for(int i=0; i Date: Wed, 18 Jan 2017 18:52:15 -0500 Subject: [PATCH 2/2] Pushing to master --- pom.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pom.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..a317f61 --- /dev/null +++ b/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + mukhtar.alfatih + ReusingClasses + 1.0-SNAPSHOT + + + + + junit + junit + 4.12 + + + + + + \ No newline at end of file