From 2c129f633f4fdf29b588214da739056d849a35bc Mon Sep 17 00:00:00 2001 From: DawnMagnet Date: Mon, 6 May 2024 15:48:15 +0800 Subject: [PATCH] fix --- course8/course_en.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/course8/course_en.md b/course8/course_en.md index 311ee87..13dbdd6 100644 --- a/course8/course_en.md +++ b/course8/course_en.md @@ -122,6 +122,11 @@ struct LinkedList[T] { } ``` +`Node[T]` is a generic struct that represents a node in a linked list. It has two fields: `val` and `next`. The `val` field is used to store the value of the node, and its type is `T`, which can be any valid data type. The `next` field represents the reference to the next node in the linked list. It is an optional field that can either hold a reference to the next node or be empty (`None`), indicating the end of the linked list. + +`LinkedList[T]` is a generic struct that represents a linked list. It has two mutable fields: `head` and `tail`. The `head` field represents the reference to the first node (head) of the linked list and is initially set to `None` when the linked list is empty. The `tail` field represents the reference to the last node (tail) of the linked list and is also initially set to `None`. The presence of the `tail` field allows for efficient appending of new nodes to the end of the linked list. + + ### Adding Elements ```moonbit