Stacks, Queues and Linked Lists

A stack, a queue and a linked list can share the same eight array elements. The data stays where it is written, and the pointers that move decide which item comes out next.

Depot
↺

What leaves the van first?

Canal Road parcel depot

Parcel and Index rows below

Canal Road depot: the working forecourt A single rear Door in the van, a sorting Desk, a Waiting pallet and the incoming Parcel share one depot forecourt. Parcel sits on the arrival pallet and can be carried to an array Index. Door Desk Waiting Parcel K8 31 Canal Road depot: phone working forecourt A single rear Door in the van, a sorting Desk, a Waiting pallet and the incoming Parcel share one depot forecourt. Parcel sits on the arrival pallet and can be carried to an array Index. Door Desk Waiting Parcel K8 31

Index rows beside the depot

walkFree walkyour edits
Restores your last edit
No items in the stack
Leaves everything in place

Delivery stops

Canal Road delivery stops The same four houses from the depot drawing. The small van marks stops actually reached by the learner’s links. House 18 18 visited House 31 31 visited House 42 42 visited House 65 65 visited Canal Road Canal Road delivery stops The same four houses from the depot drawing. The small van marks stops actually reached by the learner’s links. Canal Road House 18 18 visited House 31 31 visited House 42 42 visited House 65 65 visited

After the run

Unload
No run yet.
Unused
No run yet.

Parcels reached: —

Door / Desk

No parcel taken in this operation.

Before

Eight fixed elements per array. Each structure follows the Design beside it; other systems may use different designs.