From 59bfd44f4595ef0e5a2d4c167abe975f4b398688 Mon Sep 17 00:00:00 2001 From: finnm Date: Tue, 17 Dec 2024 13:24:50 +0100 Subject: [PATCH] Fixed the merging order of FinnSort --- .../main/java/de/uni_marburg/powersort/FinnSort/FinnSort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/de/uni_marburg/powersort/FinnSort/FinnSort.java b/app/src/main/java/de/uni_marburg/powersort/FinnSort/FinnSort.java index a0e4dbb..341603f 100644 --- a/app/src/main/java/de/uni_marburg/powersort/FinnSort/FinnSort.java +++ b/app/src/main/java/de/uni_marburg/powersort/FinnSort/FinnSort.java @@ -28,7 +28,7 @@ public class FinnSort { int p = power(runs.getLast(), new Run(i, j, 0), n); while (runs.size() >= 2 && p < power(runs.getLast(), runs.get(runs.size() - 2), n)) { - basicMerge(a, runs.removeFirst(), runs.removeFirst(), c); + basicMerge(a, runs.removeLast(), runs.removeLast(), c); } runs.add(new Run(i, j, p));