python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
import math def merge(A): if(len(A)==0 or len(A)==1): return A else: mitad = math.floor(len(A) / 2) print(len(A)) L = merge(A[0:mitad]) R = merge(A[mitad:]) res = [] while (len(L) != 0 and len(R) != 0): if(L[0] > R[0]): res = res + [L[0]] L = L[1:] else: res = res + [R[0]] R = R[1:] return res + L + R ls = [1,2,4,6,3,1] print(merge(ls))
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up