java.lang.ArrayIndexOutOfBoundsException: 2 at MergeSort.merge(MergeSort.java:80) (L[n1 + 1] = Integer.MAX_VALUE;) at MergeSort.merge_sort(MergeSort.java:58) (merge(A, p, q, r);) at MergeSort.merge_sort(MergeSort.java:56)

Stack Overflow | kgbiutcf | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    ArrayIndexOutOfBoundsException (MergeSort)

    Stack Overflow | 8 months ago | kgbiutcf
    java.lang.ArrayIndexOutOfBoundsException: 2 at MergeSort.merge(MergeSort.java:80) (L[n1 + 1] = Integer.MAX_VALUE;) at MergeSort.merge_sort(MergeSort.java:58) (merge(A, p, q, r);) at MergeSort.merge_sort(MergeSort.java:56)

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      2 at MergeSort.merge(MergeSort.java:80) (L[n1 + 1] = Integer.MAX_VALUE;) at MergeSort.merge_sort(MergeSort.java:58) (merge(A, p, q, r);) at MergeSort.merge_sort(MergeSort.java:56)

      at MergeSort.merge_sort()
    2. Unknown
      MergeSort.merge_sort
      1. MergeSort.merge_sort(MergeSort.java:56)
      2. MergeSort.merge_sort(MergeSort.java:56)
      2 frames