ASD2 Linked List
ASD2 Linked List
Faculty of Sciences
Computer Science department
1st year
2023/2024
CONTENTS
linked List definition
Structure of a list
Construction of a node
Handling simple linked lists
Construction a list
Insertion at “Head” of list
Data Link
Head Nil
CONSTRUCTION OF A NODE
Algorithm NewNode ;
Type
List=^Node;
Node = record
x: string;
Next: List;
End;
Var L
L:List;
Begin L
Allocate (L); Hello!
L^.x ‘’Hello !’’ ;
L^.Next Nil ;
End.
HANDLING SIMPLE LINKED LISTS
A linked list can be composed:
One or more nodes linked together by “next” pointers.
A pointer type variable, called “head” contains the
address of the first element of the chain.
Une liste chaînée peut être composée.
- Un ou plusieurs nœuds reliés entre eux par des pointeurs « suivant ».
- Une variable de type pointeur, appelée « head » contient l'adresse du
premier élément de la chaîne.
L
024
024
4 2 1 3 6
pL;