diff --git a/bin/lab11_debugging/NumberAnalyzer.class b/bin/lab11_debugging/NumberAnalyzer.class index e69930b..ee3d3ab 100644 Binary files a/bin/lab11_debugging/NumberAnalyzer.class and b/bin/lab11_debugging/NumberAnalyzer.class differ diff --git a/src/lab11_debugging/NumberAnalyzer.java b/src/lab11_debugging/NumberAnalyzer.java index 7105dfd..670433c 100644 --- a/src/lab11_debugging/NumberAnalyzer.java +++ b/src/lab11_debugging/NumberAnalyzer.java @@ -12,7 +12,7 @@ import java.util.Random; */ public class NumberAnalyzer { public static void main(String[] args) { - int[] array = createRandomArray(100, 100); + int[] array = createRandomArray(100, 51); displayArray(array); int position = firstRepeatedNumber(array); System.out.println("The first repeated element is at location " + position); @@ -27,7 +27,7 @@ public class NumberAnalyzer { */ public static int firstRepeatedNumber(int[] inputArray) { for (int i = 0; i < inputArray.length; i++) { - if (inputArray[i] == inputArray[i + 1]) + if (inputArray[i] == inputArray[i + 1]) // can't work, for should finish to lenght-1 return i; } return -1;