liveBook · Manning

Immutable linked list

An immutable linked list is an ordered sequence of elements linked through nodes that cannot be modified after creation.

How 2 Manning books explain it

Functional Programming in C#, Second Edition

An immutable list is an ordered collection whose contents cannot be changed after creation.

How it is used
Uses immutable lists to preserve prior values and protect account state from changes through shared collections.
How deep it goes
Implements recursive list cases, matching, length, prepending, and tail removal, including constant-time updates and empty-list handling.
Examples
Uses fruit lists to demonstrate shared tails and transaction history to illustrate defensive copying and immutable account updates.
What you can do after
Builds it from scratch using C# records and applies immutable collections to account state.

Read how Functional Programming in C#, Second Edition explains immutable linked list →

Fabulous Adventures in Data Structures and Algorithms

An immutable linked list is a linked-list data structure whose nodes and links cannot be modified after construction.

How it is used
Uses immutable linked lists to introduce recursive data structures, performance analysis, and functional programming techniques.
How deep it goes
Defines representation, construction, reversal, design flaws, and asymptotic costs, while deferring improved empty-list design to later treatment.
Examples
Demonstrates C# construction with Push, traversal through ToString, and reversal of a five-element integer list.
What you can do after
Build it from scratch in C#, construct lists with Push, reverse them without mutation, and assess time and extra-memory costs.

Read how Fabulous Adventures in Data Structures and Algorithms explains immutable linked list →

Also covered in

What to know first

Related concepts

Questions about immutable linked list

What is immutable linked list?

An immutable linked list is an ordered sequence of elements linked through nodes that cannot be modified after creation.

Which Manning books explain immutable linked list?

Functional Programming in C#, Second Edition and Fabulous Adventures in Data Structures and Algorithms.

What should I know before learning immutable linked list?

Manning books that teach immutable linked list usually introduce data structure and side effect first.

What is the difference between immutable linked list and array?

An immutable linked list is an ordered sequence of elements linked through nodes that cannot be modified after creation. An array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.

What kinds of immutable linked list are there?

Kinds of immutable linked list include cons, empty and list.

What is immutable linked list a kind of?

Immutable linked list is a kind of recursive type. A recursive type is a type whose definition refers to itself, directly or indirectly, and can represent recursively structured values.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.