Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 5.
- (defun izbrisi (x L)
- (cond
- ((null L) nil)
- ((and (atom (car L)) (not (eq (car L) x))) (cons (car L) (izbrisi x (cdr L))))
- ((and (atom (car L)) (eq (car L) x)) (izbrisi x (cdr L)))
- ((listp (car L)) (cons (izbrisi x (car L)) (izbrisi x (cdr L))))
- )
- )
- --------------------------------------
- 6.
- (defun atomi(lista)
- (if (null lista) nil
- (if (listp (car lista))
- (append (atomi (car lista)) (atomi (cdr lista)))
- (cons (car lista) (atomi (cdr lista)))
- )
- )
- )
- (defun broj_pom(el lista pom)
- (if (null lista) 0
- (if (eq (car lista) el) pom
- (broj_pom el (cdr lista) (+ 1 pom))
- )
- )
- )
- (defun redenbr(x L)
- (setq list (atomi L))
- (broj_pom x list 1)
- )
- ------------------------------------------
- 7.
- (defun otstraniNp (n lista pom)
- (
- cond
- ((null lista) nil)
- ((eq n pom) (otstraniNp n (cdr lista) (+ 1 pom)))
- ((listp (car lista)) (cons (otstraniNp n (car lista) 1) (otstraniNp n (cdr lista) (+ 1 pom))))
- (t (cons (car lista) (otstraniNp n (cdr lista) (+ 1 pom))))
- )
- )
- (defun otstraniN (n L)
- (otstraniNp n L 1)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement