(A B 3) (A C 8) (B D 2) (B E 6) (C F 7) (C D 2) (D F 2) (E F 4)
(defun mystery (list1 list2) (cond ((null list1) list2) ((null list2) list1) (t (cons (car list1) (cons (car list2) (mystery (cdr list1) (cdr list2)))))))
(mystery '(1 2 3 4) '(a b c))
(setq X (mystery (list 1 3 5 6) (list 2 4)))
mergesort
which takes an
arbitrary list of numbers and returns a sorted list by calling the
second: mergelists
which takes two sorted lists and returns
one sorted list containing all of the elements of each list. You can
also assume the functions firsthalf
which takes a list of n
items and returns a list containing the first items, and
secondhalf
which takes a list of n items and returns a list
containing the last items, as well as the
functions discussed in class. Make sure to check for the appropriate
base cases in each function.