A geocaching trail is held in a linked list using a Node class with attributes data and next. a function passed the head of the list and a new cache name, which creates a node holding that name, inserts it at the front, and returns the new head.
Loading subject…