Node 1 -%26gt; Node2 -%26gt; Node3 -%26gt; Node4 -%26gt; Node5
%26lt;- %26lt;- %26lt;- %26lt;-
A ^ is pointing to Node1,B ^ to Node2, and C ^ to Node5.
For example the info value of node 1, referenced from reference A would be A.getInfo().
a. The info value of node 1, referenced from reference C?
b The link value of node 2, referenced from reference A?
C The back value of node 1, referenced from reference A?
Note: Node1 circles back to Node 5 and vs versa.
Using a circular doubly linked list below, give the expression corresponding to each of the following descript
a.
C.next.getinfo()
b.
A.next
c.
A.back.getinfo()
A.back is the address of node 5 and address.back.getinfo the value, as you said. Same thing with A.next
Remeber that in a linked list a node has the address of the the next node (also of the previously node in this case).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment