|
Gymbo
|
Doubly Linked List Implementation. More...
#include <utils.h>
Public Member Functions | |
| Linkedlist () | |
| Default constructor for Linkedlist. More... | |
| uint32_t | len () |
| Get the length of the linked list. More... | |
| void | push (T data) |
| Pushes a new element onto the back of the linked list. More... | |
| T * | back () |
| Returns the element at the back of the linked list. More... | |
| void | pop () |
| Pops the element at the back of the linked list. More... | |
Public Attributes | |
| LLNode< T > * | ghost |
| Ghost node for maintaining previous tails during pops. More... | |
| LLNode< T > * | head |
| Pointer to the head of the linked list. More... | |
| LLNode< T > * | tail |
| Pointer to the tail of the linked list. More... | |
Doubly Linked List Implementation.
The Linkedlist class provides a simple implementation of a doubly linked list. It supports basic operations such as pushing elements onto the back, getting the length, accessing the element at the back, and popping the element at the back.
| T | The type of data to store in the linked list. |
|
inline |
Default constructor for Linkedlist.
|
inline |
Returns the element at the back of the linked list.
|
inline |
Get the length of the linked list.
|
inline |
Pops the element at the back of the linked list.
|
inline |
Pushes a new element onto the back of the linked list.
| data | The element to push onto the linked list. |
| LLNode<T>* gymbo::Linkedlist< T >::ghost |
Ghost node for maintaining previous tails during pops.
| LLNode<T>* gymbo::Linkedlist< T >::head |
Pointer to the head of the linked list.
| LLNode<T>* gymbo::Linkedlist< T >::tail |
Pointer to the tail of the linked list.