W
W
wolverine7772021-11-19 02:00:53
Lisp
wolverine777, 2021-11-19 02:00:53

How to add a leaf to a leaf using cons?

Hello, I need to create such a sheet but with the help , since with -ami it is, of course, created very simply: Here is what I got today:(1 (2 3) (4 5))conslist(list 1 (list 2 3)(list 4 5))


(cons 1      
      (cons '()
      (cons
       (cons 4 (cons 5 '())) '())))


However, I don’t understand how to add the remaining sheet Thank you (cons 2 (cons 3 '()))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2021-11-19
@wolverine777

(cons 1
   (cons
     (cons 2 (cons 3 '()))
     (cons (cons 4 (cons 5 '())) '())))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question