The code is missing a return statement in the mergesort function. Without a return statement, the function does not return any value and the sorted list is not returned.

To fix this, you can add a return statement at the end of the mergesort function:

return list

Additionally, you should avoid using the name "list" as a variable name since it is a built-in Python function. You can use a different variable name, such as "lst".

list = 23125484-43def mergesortlist if lenlist1 mid = lenlist2 L = listmid R = listmid mergesortL mergesortR i = j = k = 0 while i lenL and j lenR

原文地址: http://www.cveoy.top/t/topic/iSOi 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录