Does the head node in a link list have any info or does it only point to the first node of a link list ?
Can we define a head node as the starting node of the link list ?
Does a head node only point to the first node?
A linked list consists of nodes, and each node contains some data and a link to another node in the list. But is the very first node a node which contains data and a link to the second node? Or is it contain only a link (and no data) to a node? I thought that the very first node in a linked list has both data and a link to another node, but in one introductory book it is explained that the head is a node but a link that gets you to the first node. At the same time head is a variable of the type of the node. Why is it like this?
Does the head node in a link list have any info or does it
Share
Conventionally the head node is the very first node of the linked list but from a “type” point of view it is no different than any other node. It does contain data as well as a pointer to the next node (the second node of your linked list, if it exists).