Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def merge(lst1, lst2):
- if len(lst1) == 0:
- return lst2
- if len(lst2) == 0:
- return lst1
- if lst1[0] > lst2[0]:
- return [lst2[0]] + merge(lst1, lst2[1:])
- else:
- return [lst1[0]] + merge(lst1[1:], lst2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement