From 6201c7658e203617d19f816ebf33f37bdd4f5c5f Mon Sep 17 00:00:00 2001 From: fdai7222 Date: Thu, 21 Apr 2022 14:09:23 +0200 Subject: [PATCH 1/9] test1 --- ArrayManipulation.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ArrayManipulation.java diff --git a/ArrayManipulation.java b/ArrayManipulation.java new file mode 100644 index 0000000..22b6ed2 --- /dev/null +++ b/ArrayManipulation.java @@ -0,0 +1,22 @@ +import java.util.Arrays; + +public class ArrayManipulation { + + + public static int[] reverseArray(int[] arr) { + + for (int i = 0; i < arr.length/2; i++) { + int tmp = arr[i]; + arr[i] = arr[arr.length - 1 - i]; + arr[arr.length - 1 - i] = tmp; + } + return arr; + + } + public static void main(String[] args) { + + int[] arr = {1,2,3,4,5}; + System.out.println(Arrays.toString(reverseArray(arr))); + + } +} From 22ce4d7ec90c91be56dec0797a713d971bbcb08e Mon Sep 17 00:00:00 2001 From: fdai7222 Date: Thu, 21 Apr 2022 14:25:18 +0200 Subject: [PATCH 2/9] =?UTF-8?q?=E2=80=9EArrayManipulation.java=E2=80=9C=20?= =?UTF-8?q?=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit testmanipulatioin --- ArrayManipulation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 22b6ed2..92a462a 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -19,4 +19,5 @@ public class ArrayManipulation { System.out.println(Arrays.toString(reverseArray(arr))); } + test } From bd501d10a71b3ca8a8898daef6af75ff20d8d7d3 Mon Sep 17 00:00:00 2001 From: fdai6940 Date: Fri, 22 Apr 2022 10:56:53 +0200 Subject: [PATCH 3/9] =?UTF-8?q?Janniks=20=C3=84nderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArrayManipulation.java | 1 - 1 file changed, 1 deletion(-) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 92a462a..aea7c55 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -4,7 +4,6 @@ public class ArrayManipulation { public static int[] reverseArray(int[] arr) { - for (int i = 0; i < arr.length/2; i++) { int tmp = arr[i]; arr[i] = arr[arr.length - 1 - i]; From 66ddd1de2feaaf86fd604a014f64a373c21f214f Mon Sep 17 00:00:00 2001 From: fdai7222 Date: Fri, 22 Apr 2022 11:31:30 +0200 Subject: [PATCH 4/9] =?UTF-8?q?removeFirst=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArrayManipulation.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index aea7c55..9ce02e6 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -2,8 +2,18 @@ import java.util.Arrays; public class ArrayManipulation { + + public static int[] removeFirst(int[] arr){ + int[] result = new int[arr.length-1]; + for(int i = 1; i < arr.length, i++){ + result[i-1] = arr[i]; + } + return result; + } + public static int[] reverseArray(int[] arr) { + for (int i = 0; i < arr.length/2; i++) { int tmp = arr[i]; arr[i] = arr[arr.length - 1 - i]; @@ -18,5 +28,4 @@ public class ArrayManipulation { System.out.println(Arrays.toString(reverseArray(arr))); } - test } From 78d16bc0823cdbda0e376ed077ceaba9a081881d Mon Sep 17 00:00:00 2001 From: fdai6372 Date: Fri, 22 Apr 2022 11:41:30 +0200 Subject: [PATCH 5/9] =?UTF-8?q?squareEach=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArrayManipulation.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 9ce02e6..6dd0271 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -11,6 +11,17 @@ public class ArrayManipulation { return result; } + + public static int[] squareEach(int[] arr) { + + int[] result = new int[arr.length]; + for(int i = 0; i < arr.length; i++) { + result[i] = arr[i] * arr[i]; + } + return result; + + } + public static int[] reverseArray(int[] arr) { @@ -25,7 +36,11 @@ public class ArrayManipulation { public static void main(String[] args) { int[] arr = {1,2,3,4,5}; + System.out.println(Arrays.toString(removeFirst(arr))); + System.out.println(Arrays.toString(squareEach(arr))); System.out.println(Arrays.toString(reverseArray(arr))); + + } } From 93ca5eae6a6fa3037e1434174961242665e59cb2 Mon Sep 17 00:00:00 2001 From: fdai6372 Date: Fri, 22 Apr 2022 11:50:39 +0200 Subject: [PATCH 6/9] =?UTF-8?q?removeLast=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArrayManipulation.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 6dd0271..54463fa 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -11,6 +11,14 @@ public class ArrayManipulation { return result; } + public static int[] removeLast(int[] arr) { + int[] result = new int[arr.length-1]; + for(int i = 0; i < arr.length - 1; i++) { + result[i] = arr[i]; + } + return result; +} + public static int[] squareEach(int[] arr) { @@ -37,6 +45,7 @@ public class ArrayManipulation { int[] arr = {1,2,3,4,5}; System.out.println(Arrays.toString(removeFirst(arr))); + System.out.println(Arrays.toString(removeLast(arr))); System.out.println(Arrays.toString(squareEach(arr))); System.out.println(Arrays.toString(reverseArray(arr))); From 264d1f4095ac328dbf050e41613e1f623b54f58a Mon Sep 17 00:00:00 2001 From: fdai7222 Date: Fri, 22 Apr 2022 12:39:17 +0200 Subject: [PATCH 7/9] Update ArrayManipulation.java --- ArrayManipulation.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 54463fa..ff17bbd 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -1,3 +1,5 @@ +//coding Team 53 + import java.util.Arrays; public class ArrayManipulation { From d621d77886e0450c24614dca7fbca4263388ede3 Mon Sep 17 00:00:00 2001 From: fdai6372 Date: Fri, 22 Apr 2022 12:41:53 +0200 Subject: [PATCH 8/9] Update --- ArrayManipulation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index ff17bbd..53c0ef8 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -1,4 +1,4 @@ -//coding Team 53 +//coding Team 53 :) import java.util.Arrays; From df0ffdce1b2badd549db1092b03b5544360ca4d7 Mon Sep 17 00:00:00 2001 From: fdai6940 Date: Sat, 23 Apr 2022 12:30:33 +0200 Subject: [PATCH 9/9] Update --- ArrayManipulation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArrayManipulation.java b/ArrayManipulation.java index 53c0ef8..c92f5f9 100644 --- a/ArrayManipulation.java +++ b/ArrayManipulation.java @@ -1,4 +1,4 @@ -//coding Team 53 :) +//Coding Team 53 :) import java.util.Arrays;