liveBook · Manning

Node

As explained in Algorithms Every Programmer Should Know

A node is an element of a linked structure that stores data and one or more links to other nodes.

A node stores its own data and a link to another node. In a linked list, each node points to the next, so you follow the links from the head instead of jumping directly to a position as you can with an array. section 1.4.2

Figure 1.4 Illustration of a linked list with four nodes. Each node has data and a pointer pointing to the next node. The start of the linked list is marked as head. The end of the linked list is identified if the next pointer is null.

Trace how each node’s pointer connects it to the next, from the head to the end of the list. section 1.4.2

A doubly linked-list node also points backward, allowing traversal in both directions at the cost of extra memory. In a tree, nodes form a hierarchy: a node can be a parent or child, and the top node is the root. section 1.4.2 section 1.4.4

How Algorithms Every Programmer Should Know covers it

How deep it goes
Defines linked-list node fields and tree relationships, without detailing tree-node implementation.
Examples
Illustrates nodes as a linked-list chain and as roles in a tree hierarchy.
What you can do after
Understand how node links support traversal in lists and relationships in trees.
How it connects
Connects to linked lists, doubly linked lists, and trees.

Also explained in

Compare how 2 books explain node →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Algorithms Every Programmer Should Know. The section links point to the parts of the book it draws on.