From 456b3cfa0c7bdbd67eee0ce27a51931db3ccd672 Mon Sep 17 00:00:00 2001 From: Jawadaz Date: Sun, 27 Mar 2022 13:24:40 +0200 Subject: [PATCH] b should be sorted as per the assumption The previous b values {1, 4, 7, 6, 7, 7} don't represent a sorted array. --- java/Chapter 11/Question11_1/Question.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/Chapter 11/Question11_1/Question.java b/java/Chapter 11/Question11_1/Question.java index 94d5020a..125891d1 100644 --- a/java/Chapter 11/Question11_1/Question.java +++ b/java/Chapter 11/Question11_1/Question.java @@ -31,7 +31,7 @@ public static void merge(int[] a, int[] b, int lastA, int lastB) { public static void main(String[] args) { int[] a = {2, 3, 4, 5, 6, 8, 10, 100, 0, 0, 0, 0, 0, 0}; - int[] b = {1, 4, 7, 6, 7, 7}; + int[] b = {1, 4, 5, 6, 7, 7}; merge(a, b, 8, 6); System.out.println(AssortedMethods.arrayToString(a)); }