Tuesday, June 5, 2007

Question 10

Consider a unidirectional list such as given in the figure below. “Tokyo” is at the top of the list and the value of the associated pointer is the address for the data that follows next. “Milan” is at the end of the list and the value of the associated pointer is 0.
Which of the possible answers is the correct procedure for witching “London” and “Paris”?

Pointer to data
at top of list

Address Data Pointer

120 100 Vienna 160

120 Tokyo 180
140 Paris 999
160 Milan 0
180 London 100

a) Set the value of the pointer for Paris to “100,” and set the pointer for Tokyo to “140.”
b) Set the value of the pointer for Paris to “100,” and set the pointer for London to “140.”
c) Set the value of the pointer for Paris to “180,” and set the pointer for Tokyo to “140.”
d) Set the value of the pointer for Paris to “180,” and set the pointer for London to “140.”

answer

No comments: