2025 init

This commit is contained in:
Romain Lefeuvre
2025-11-18 14:44:07 +01:00
commit ac81d61d01
21 changed files with 986 additions and 0 deletions

23
exercises/sorting.md Normal file
View File

@@ -0,0 +1,23 @@
# Sorting algorithms
Implement [Bubble sort](https://en.wikipedia.org/wiki/Bubble_sort), [Quicksort](https://en.wikipedia.org/wiki/Quicksort) and [Merge sort](https://en.wikipedia.org/wiki/Merge_sort) in the `Sorting` class as indicated below. The three methods return a sorted version of the original array. The comparison between the elements of the arrays is specified with an instance of `Comparator`.
```java
class Sorting {
public static T[] bubblesort(T[] array, Comparator<T> comparator) { ... }
public static T[] quicksort(T[] array, Comparator<T> comparator) { ... }
public static T[] mergesort(T[] array, Comparator<T> comparator) { ... }
}
```
Using [jqwik](https://jqwik.net/) create a differential fuzzing strategy to test the three sorting algorithms at the same time. Create the test before any sorting implementation. Document any bug you find with the help of your tests.
**NOTE:**
- Do not use any existing implementation, write your own code.
- Use the provided project template as a starting point.
- In the project you can launch the tests with `mvn test`.