Singly structure with length of the list and its head
| 8 | |
| 9 | // Singly structure with length of the list and its head |
| 10 | type Singly[T any] struct { |
| 11 | length int |
| 12 | |
| 13 | // Note that Node here holds both Next and Prev Node |
| 14 | // however only the Next node is used in Singly methods. |
| 15 | Head *Node[T] |
| 16 | } |
| 17 | |
| 18 | // NewSingly returns a new instance of a linked list |
| 19 | func NewSingly[T any]() *Singly[T] { |
nothing calls this directly
no outgoing calls
no test coverage detected