Insertion sort | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
12th Jul 2020, 8:20 AM
C Alpha Beraka
C Alpha Beraka - avatar
4 Answers
0
I m unable to run the program, its showing exception
12th Jul 2020, 8:50 AM
C Alpha Beraka
C Alpha Beraka - avatar
0
Something related to index
12th Jul 2020, 8:50 AM
C Alpha Beraka
C Alpha Beraka - avatar
0
Your arr array ldngth is n=4. But in line arr[n+1]=arr[n]; Here your accessing n+1 location.. Which is invalid.. So it raise exception.. You can change or extend array length.. And Why are you printing newarr values, which are not set only intilized to 0 and not modified any where...
12th Jul 2020, 10:07 AM
Jayakrishna 🇮🇳
0
Insert sort.. How you are trying this here..? Which one or in which you want to insert 10?
12th Jul 2020, 10:47 AM
Jayakrishna 🇮🇳