0
Y I'm getting none as output
5 odpowiedzi
+ 2
Shivam,
Code requires little change
In merge() function
Condition needs to be corrected
if not (len(left) or len(right)):
one parenthesis will make every thing in order.
In merge sort it first divides list into halves each iteration
till it becomes empty, after that it merges divided lists with sorting till sorted single list.
Hope this will it clear rest of the part is correct.
+ 2
Shivam,
Another change required is indentation in merge_sort() function, all the code bellow
if statement is not indented correctly
Indentation is big problem with python with it code cannot work as intended.
+ 1
Because all your main code of merge_sort in if len<2
0
Tysm
0
I did it tysm for helping