- Lists
- Sets
- Tuples
- Stacks
LinkedList is a sequence of nodes that have properties and a reference to the next node in
the sequence. It is a linear data structure that is used to store data. The data structure
permits the addition and deletion of components from any node next to another node. They
are not stored contiguously in memory, which makes them different arrays.
type Node struct{
property int
nextNode *Node
}
The LinkedList class has headNode pointer as its property.
// LinkedList class
type LinkedList struct {
headNode *Node
}
// Node class
type Node struct {
property int
nextNode *Node
previousNode *Node
}