Why does this code give index error ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
21st Dec 2018, 6:45 PM
shreyash joshi
shreyash joshi - avatar
4 Answers
+ 1
It is a shorter version of merge sort. It sorts and merge a list which has its two half sorted.for example if input is 10, 20 , 30,3,7,9 then output will be 3,7,9,10,20,30.i fix it,list was becoming empty at some point.so a large element has to be added at end of both half list.
22nd Dec 2018, 4:30 AM
shreyash joshi
shreyash joshi - avatar
0
Check Line 8. Change the 0 to the maximum number you will accept as input. An example is 10 if you want your range to be 1 to 9.
21st Dec 2018, 6:48 PM
Victor Oliveros
Victor Oliveros - avatar
0
No, that's not working ,i did.
21st Dec 2018, 6:54 PM
shreyash joshi
shreyash joshi - avatar
0
What exactly is your code supposed to do?
21st Dec 2018, 11:08 PM
Diego
Diego - avatar