Linked List - M-Choice Question

Y

yogi_bear_79

Assume a linked list of nodes which have an info data member and a
next data member. Suppose a pointer called cursor points to a node in
the middle of the linked list. To move ptr to the next node use:


ptr=next;
next->ptr;
ptr->next;
ptr=ptr->next;
none of the above.

I want to anwser none of the above as i feel it should be cursor-
next; But I could also anwser ptr->next; if I disregard the info
leading up to last sentacne which is the actual question (To move ptr
to the next node use:). is this a trick question, or am i reading to
much into it?
 
O

osmium

yogi_bear_79 said:
Assume a linked list of nodes which have an info data member and a
next data member. Suppose a pointer called cursor points to a node in
the middle of the linked list. To move ptr to the next node use:


ptr=next;
next->ptr;
ptr->next;
ptr=ptr->next;
none of the above.

I want to anwser none of the above as i feel it should be cursor-
leading up to last sentacne which is the actual question (To move ptr
to the next node use:). is this a trick question, or am i reading to
much into it?

My guess is that is not meant to be a trick question, just a question posed
by somene who has difficulty saying what he means. "Suppose a pointer
called cursor... " There is no such pointer in the code. Did he mean "To
change ptr to point to the next node?" That isn't what he says, is it?
 
E

Erik Wikström

Assume a linked list of nodes which have an info data member and a
next data member. Suppose a pointer called cursor points to a node in
the middle of the linked list. To move ptr to the next node use:


ptr=next;
next->ptr;
ptr->next;
ptr=ptr->next;
none of the above.

I want to anwser none of the above as i feel it should be cursor-
leading up to last sentacne which is the actual question (To move ptr
to the next node use:). is this a trick question, or am i reading to
much into it?

If we assume that it is not a trick question the correct answer is 4
(ptr=ptr->next). If it is a trick question (which I doubt) then the
correct answer is 5 (none of the above), just like you said.
 
D

Daniel Pitts

yogi_bear_79 said:
Assume a linked list of nodes which have an info data member and a
next data member. Suppose a pointer called cursor points to a node in
the middle of the linked list. To move ptr to the next node use:


ptr=next;
next->ptr;
ptr->next;
ptr=ptr->next;
none of the above.

I want to anwser none of the above as i feel it should be cursor-
leading up to last sentacne which is the actual question (To move ptr
to the next node use:). is this a trick question, or am i reading to
much into it?
My guess is that its a typographical error, and that they intented "ptr"
and "cursor" to be the same thing. I'd suggest trying to get
clarification if possible.
 
Y

yogi_bear_79

My guess is that its a typographical error, and that they intented "ptr"
and "cursor" to be the same thing.  I'd suggest trying to get
clarification if possible.

I'd imagine it is not supposed to be a trick. Asking for clarification
has proved pointless. This is the second of four tests. I asked for
clarification after I took the first one, and received nada. The tests
are extremely badly written. They are not in the text book.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,490
Latest member
Finplus

Latest Threads

Top