Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DawnMagnet committed May 6, 2024
1 parent ee5f17b commit 2c129f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions course8/course_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c129f6

Please sign in to comment.