Closed lcunild closed 4 years ago
Null Pointer basically means you are trying to access some out-of-boudary index of certain arrays. Be really careful the index issues.
Please take a look at the error log. You can find in some certain line the index you dynamically access may be not valid.
More specifically, the bug is introduced by L160.
I think I have worked out why I was getting the null pointer exception, however now the exception I am getting is java.lang.ClassCastException: : class [[Ljava.lang.Integer; cannot be cast to class [Ljava.lang.Comparable. I do not get this error if I try to create a copy of the array in my main method, only when I try to do it in the merge method.
I have sorted it, thank you for your help!
I have tried implementing the improvement as discussed in office hours, however I am getting a null pointer exception (line 160) and I cannot figure out why.
https://github.com/lcunild/dsa-java/blob/master/src/main/java/edu/emory/cs/sort/hybrid/HybridSortHW.java