Head and Tail

say it: “HED and TAYL” /hɛd ænd teɪl/

The first node and the last node of a linked list, each usually kept in a reference of its own.

What is the head and the tail of a linked list?

The head is the first node of a linked list, where every walk starts; the tail is the last node, whose next reference is empty. Keeping a reference to each makes adding at the front and adding at the end both O(1), which is why a linked list with a head and a tail makes a fast queue.

Level: Apprentice · More Data Structures terms at this level

Updated

In other subjects