Wednesday, 15 April 2015

Comparing two lists Recursively in LISP -



Comparing two lists Recursively in LISP -

i trying create function compares contents of 2 lists sorted ascendancy , creates 1 list sorted ascendancy.

for illustration (4 6 8 9 10) (1 2 5 7 9) become (1 2 4 5 6 7 8 9 9 10)

as working recursion expect must done recursively. knowledge of lisp limited , struggling greatly. help appreciated.

you don't need implement yourself. mutual lisp has function merge:

cl-user> (merge 'list '(4 6 8 9 10) '(1 2 5 7 9) '<) (1 2 4 5 6 7 8 9 9 10)

common-lisp

No comments:

Post a Comment