That is called a Linked list:

Each element doesn't know where they are in the world, but they know who their neighbors are. The end elements obviously know that they are the end elements because...