If the link list is empty, the function links the newly-created record to the head of the list. If the link list is not empty, it loops over all records until the end of the list and then adds the new record to the end of the list.