Created
April 20, 2020 12:45
-
-
Save JeffersonCarvalh0/199367f07c7322cc9efc85455b2f8a65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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