Function to merge sorted lists
Edward C. Jones
edcjones at erols.com
Thu Aug 30 21:20:44 EDT 2001
Has anyone written in C a merge function for sorted Python sequences? It
should look like:
merged_list, tail1, tail2 = merge(list1, list2)
where either tail1 or tail2 is []. Suppose tail1 is []. Then tail2 is a
terminal sublist of list2, the last element of merged_list is the last
element of list1, and merged_list + tail2 is the merger of list1 and
list2. Similarly if tail2 is [].
This function would be useful for writing external merge sort programs.
Thanks,
Ed Jones
More information about the Python-list
mailing list