Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Linked list, cell?

Ook bekend als: linked list · cell (linked list) · cell (of a linked list) · singly linked list · doubly linked list

Definition 24.2 High School Computer Science · Hoofdstuk 24 — Linked Lists, Stacks and Queues

A linked list is a sequence stored as a chain of cells: each cell holds one value and a link to the next cell, and the last cell’s link is None. The list is known by its first cell, its head.

The linked list 3, 1, 4, 1. Walking it means following the links from the head; the crossed box is the link None of the last cell. Inserting at the head is one new cell whose link is the old head.
The linked list 3,1,4,13, 1, 4, 1. Walking it means following the links from the head; the crossed box is the link None of the last cell. Inserting at the head is one new cell whose link is the old head.
Lees in het hoofdstuk →
Definition 15.1 University Computer Science — Year 1 · Hoofdstuk 15 — Linked Structures: Lists, Stacks and Queues

A linked list stores a sequence in cells, each holding one element and a pointer to the next cell; the last cell’s pointer is null, and the list is given by a pointer to its first cell (null for the empty list). In a singly linked list each cell knows only its successor; in a doubly linked list it also knows its predecessor.

A singly linked list 1, 2, 3, and the insertion of 25 after the cell holding 2: first the new cell points to the successor, then the cell points to the new one; the dashed link is the one replaced.
A singly linked list 1,2,31, 2, 3, and the insertion of 25 after the cell holding 2: first the new cell points to the successor, then the cell points to the new one; the dashed link is the one replaced.
Removing 2 with a pointer to a link: link holds the address of the field that leads to the cell, here the next field of the cell 1, and the field is redirected past the cell. Removing 1 would redirect head the same way.
Removing 2 with a pointer to a link: link holds the address of the field that leads to the cell, here the next field of the cell 1, and the field is redirected past the cell. Removing 1 would redirect head the same way.
Lees in het hoofdstuk →