(defun reverse-help (oldlist newlist)
(cond ((null oldlist) newlist)
(t (reverse-help (cdr oldlist) (cons (car oldlist) newlist)))))
(defun my-reverse (list)
(reverse-help list nil))
0 |
1 |
10 |
11 |
100 |
101 |
110 |
111 |
1000 |
20 |
21 |
22 |
23 |
|||||
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
15
/ \
14 23
/ / \
3 18 27
\
5