Hints on recursion
- From: "zion_zii" <nick.kigs@xxxxxxxxx>
- Date: 29 Nov 2005 06:31:34 -0800
Hello to all!!
I am just learning lisp and I was doing some exercises and got stuck.
The problem is as follows:
Given a list (lst) and a key (a), return true if a occurs twice in the
list. There are stipulations however and they are;
1. You are to only use COND/IF, NULL, EQ and OR. That means that you
cant use the
(+ (recurse the same function) 1) construct nor introduce any symbol
that keeps track of the count. (+ isnt included in what to use for this
problem)
2. Use recursion only for the problem therefore, you cant use any of
the loops
3. You cant use any of the binding forms either e.g let etc
You cant use anything else not included in line 1 above.
Okay. I know this is easy for almost all of you but Im learning. I
would NOT like the answer to this problem just hints (otherwise Im
going to despise myself for not thinking about the answer you give) so
I can understand the solution better.
Thanks in advance for your help. VIVA lisp!!
.
- Follow-Ups:
- Re: Hints on recursion
- From: Kaz Kylheku
- Re: Hints on recursion
- From: mpeever
- Re: Hints on recursion
- From: Pascal Bourguignon
- Re: Hints on recursion
- Prev by Date: Re: How can I sort symbols in alphabetical order?
- Next by Date: Re: How can I sort symbols in alphabetical order?
- Previous by thread: How can I sort symbols in alphabetical order?
- Next by thread: Re: Hints on recursion
- Index(es):