Hi,
hopefully this is an easy question:
if you create a data structure in
java (eg, a linked list), how would you access a particular node and, say, change the data in it, leaving the rest of the data structure unchanged? So if you've got a linked list of 3 elements, like
47 -> 38 -> 24
how would you go about changing the 2nd element to 37? Assuming the code for the structure is something like
If you were to use the getNext method, you'd get a copy of the second element rather than accessing the real second element, which isn't what I want.
Any help would be much appreciated.
thanks,
Graham.