views:

30

answers:

1

I read a sentence saying two links attached end-to-end. What does it look like?

Suppose we have

L1->A->B->C->D

and

L2->a->b->c->d

should it be

1)

L1->A->B->C->D->L2->a->b->c->d

or

2)

L1->A->B->C->D-> d<-c<-b<-a<-L2
+1  A: 

I would say the first one. The second one doesn't make much sense to me (ie I can't think of a good use for such a structure, unless you were creating a graph, but it doesn't seem like your problem/book/chapter is talking about that right now.) Both links point to 'd' but still terminate there, which doesn't seem as useful as being able to take 2 linked lists and create one big one.

rascher