so*****@somedomain.com.invalid wrote:

Can someone briefly explain what this recursive algorithm involving circularly linked lists does? Thanks in advance.

bool nine(node *p, node *q)

{ if (p == NULL && q == NULL) return TRUE;

else if (p->data == q->data)

{ p=p->link; q=q->link; nine(p,q); }

else return FALSE;

}

Has the semester started already?

At least you could have changed the name of the function -- erm, `nine'

pretty much gives it away, doesn't it?

Also, you really _should_ have provided the definition of `node'.

[Even worse, it doesn't even work. Do you know why?]

--ag

--

Artie Gold -- Austin, Texas