Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

final

(defun ortak (list1 list2)
    (cond 
        ((null list1) nil)
        ((member (car list1) list2)(append (list (car list1)) (ortak (cdr list1) list2))  )
        (t   (ortak (cdr list1) list2))
    )
)
(setq a '(2 10 4))
(setq b '(1 2 3 4 5 6))
(write (ortak a b))
(terpri)

(defun add (list1 elem)
    (cond
        ((null list1) (append (list elem)))
        ((< elem (car list1)) (append (list elem) list1))
        (t (append (list (car list1)) (add (cdr list1) elem)))
    )
)
(write (add b 7))
(terpri)
(defun sortt (list1 &optional list2)
    (cond 
        ((null list1) list2)
        ((null list2) (sortt (cdr list1) (list (car list1))))
        (t (setq list2 (add list2 (car list1))) (sortt (cdr list1) list2) )
    )
)
(write (sortt a))

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.