Skip to content

Instantly share code, notes, and snippets.

@JeffersonCarvalh0
Created April 20, 2020 12:45
Show Gist options
  • Save JeffersonCarvalh0/199367f07c7322cc9efc85455b2f8a65 to your computer and use it in GitHub Desktop.
Save JeffersonCarvalh0/199367f07c7322cc9efc85455b2f8a65 to your computer and use it in GitHub Desktop.
def merge( A, B ):
if empty( A ):
return B
if empty( B ):
return A
if A[ 0 ] < B[ 0 ]:
return concat( A[ 0 ], merge( A[ 1...A_n ], B ) )
else:
return concat( B[ 0 ], merge( A, B[ 1...B_n ] ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment