From 51bf2d7cd090d3d108eace26c23ef3a29c3de395 Mon Sep 17 00:00:00 2001 From: zanninso Date: Tue, 9 Apr 2024 01:16:39 +0000 Subject: [PATCH 1/2] docs: adding subject --- .../java/checkpoints/sort-array/README.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 subjects/java/checkpoints/sort-array/README.md diff --git a/subjects/java/checkpoints/sort-array/README.md b/subjects/java/checkpoints/sort-array/README.md new file mode 100644 index 000000000..4c9c897a6 --- /dev/null +++ b/subjects/java/checkpoints/sort-array/README.md @@ -0,0 +1,39 @@ +## SortArray + +### Instructions + +In a file named `SortArray.java` write a function `sort` that sorts ascending the given array specified in the parameters and returns it. + +### Expected Functions + +```java +public class SortArray { + public static Integer[] sort(Integer[] args) { + // your code here + } +} +``` + +### Usage + +Here is a possible `ExerciseRunner.java` to test your function : + +```java +import java.io.*; +import java.util.Arrays; + +public class ExerciseRunner { + public static void main(String[] args) throws IOException { + System.out.println(Arrays.toString(SortArray.sort(new Integer[]{4, 2, 1, 3}))); + } +} +``` + +and its output : + +```shell +$ javac *.java -d build +$ java -cp build ExerciseRunner +[1, 2, 3, 4] +$ +``` From bb10d5a6f3d30e87c5371e984c327c0ac1705ac2 Mon Sep 17 00:00:00 2001 From: amine Date: Wed, 17 Apr 2024 17:10:57 +0100 Subject: [PATCH 2/2] docs: rephrase exercice description to improve its clarity --- subjects/java/checkpoints/sort-array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/java/checkpoints/sort-array/README.md b/subjects/java/checkpoints/sort-array/README.md index 4c9c897a6..9711c0182 100644 --- a/subjects/java/checkpoints/sort-array/README.md +++ b/subjects/java/checkpoints/sort-array/README.md @@ -2,7 +2,7 @@ ### Instructions -In a file named `SortArray.java` write a function `sort` that sorts ascending the given array specified in the parameters and returns it. +In a file named `SortArray.java` write a function `sort` that returns the given array, specified in the parameters, sorted in ascending order. ### Expected Functions