Insertion Sort 1 Comments

Comments

  • 1 3 3
    1 2 3
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
    at Main.insertSort(Main.java:12)
    at Main.doStuff(Main.java:6)

    cont...
  • import java.util.*;
    class Main{
    static void doStuff(int[] ar){
    //your code here
    int n=ar[ar.length-1];
    insertSort(ar,n);

    }
    static void insertSort(int[] ar,int n){
    
    cont...
  • Dear Admin,

    As what i can see from the "Your Output" it is the same as "Correct Output", however the last array is not displayed so im not sure if im getting "Incorrect" due to the last array or something else.

    cont...
  • @David, it displays all the output. Make sure you're printing the final steps too.

  • Thanks Admin, i noticed just now... double checking on my end needs to be improved.

Contact Us
Sign in or email us at [email protected]