Please help me to resolve my issue on mergesort python got after a lot of effort I m unable to get my expected output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please help me to resolve my issue on mergesort python got after a lot of effort I m unable to get my expected output

It gives same list as out which I entered as input I don't know why it seems to ab all okk please help me to find error here I used two function one for merge the to sorted list and another for sort the divided list https://code.sololearn.com/cZ20rHp0xtwu/?ref=app

17th Apr 2020, 2:40 AM
Mangal Verma
Mangal Verma - avatar
3 Answers
+ 1
In line no. 16 chamge 'if' to 'while', otherwise it will execute only once.
17th Apr 2020, 3:05 AM
Arvind Singh Rawat
Arvind Singh Rawat - avatar
0
It still not working for another input😞
17th Apr 2020, 3:24 AM
Mangal Verma
Mangal Verma - avatar
0
In line 10, left = mergesort(left) In line 11, right = mergesort (right) You are not assigning them to variables, thats why it is using old value
17th Apr 2020, 3:42 AM
Arvind Singh Rawat
Arvind Singh Rawat - avatar