Even though any implementation is going to need references internally to get its
job done, it is a misconception that the links themselves must be references.
In the implementation below, the nodes are linked together by the value of the ID.
So, given the "next ID" of one node, you look it up in a hash to find the actual
next node. Sometimes I find this a nicer way to work. One caveat is that, as a
consequence, IDs are required to be unique.
Not that that's a bad thing, most of the time...

Note also that by not having nodes contain references to other nodes, this kind of
implementation is free from the memory leak problem cited by others in this thread.
(On the other hand, it introduces a possibility for broken links, since they are
essentially weak references.)

I never expose the structure of the node, nor any of the data members other than the
id and the value. The caller must not be allowed to twiddle with the innards, or
you'll have a recipe for disaster.