I'm not getting sorted array ????? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

I'm not getting sorted array ?????

i use merge sort algo to sort my array but there is something wrong which i have written pls help me to find out šŸ˜ Check my attempt here šŸ‘‡ https://code.sololearn.com/c7uz9habOz21/?ref=app

22nd Aug 2022, 5:48 AM
Davinder Kumar
Davinder Kumar - avatar
2 Respostas
+ 1
JayakrishnašŸ‡®šŸ‡³ it took me long time to find a problem in this code. finally resolved it. Thanks you
22nd Aug 2022, 12:08 PM
Davinder Kumar
Davinder Kumar - avatar
0
In the first for loop of mergesort() method, use array "a", not b. And in merge() method, use index as k => c[k] for all "c" Array instances...
22nd Aug 2022, 10:49 AM
Jayakrishna šŸ‡®šŸ‡³