Documentation ¶
Index ¶
- Variables
- type CircularQueue
- type LinkedList
- func (ll *LinkedList[K, T]) AddToBack(key K, val T) *ListNode[K, T]
- func (ll *LinkedList[K, T]) AddToFront(key K, val T) *ListNode[K, T]
- func (ll *LinkedList[K, T]) Len() int
- func (ll *LinkedList[K, T]) MoveToFront(node *ListNode[K, T])
- func (ll *LinkedList[K, T]) PopBack() (*ListNode[K, T], error)
- func (ll *LinkedList[K, T]) PopFront() (*ListNode[K, T], error)
- func (ll *LinkedList[K, T]) Remove(node *ListNode[K, T])
- type ListNode
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyList error = fmt.Errorf("List is empty\n")
Functions ¶
This section is empty.
Types ¶
type CircularQueue ¶
type CircularQueue[T any] struct { // contains filtered or unexported fields }
func NewCircularQueue ¶
func NewCircularQueue[T any](size int) *CircularQueue[T]
func (*CircularQueue[T]) Read ¶
func (cq *CircularQueue[T]) Read() T
func (*CircularQueue[T]) Write ¶
func (cq *CircularQueue[T]) Write(newElements []T)
type LinkedList ¶
LinkedList operations are not thread safe.
func NewLinkedList ¶
func NewLinkedList[K any, T any]() *LinkedList[K, T]
func (*LinkedList[K, T]) AddToBack ¶
func (ll *LinkedList[K, T]) AddToBack(key K, val T) *ListNode[K, T]
func (*LinkedList[K, T]) AddToFront ¶
func (ll *LinkedList[K, T]) AddToFront(key K, val T) *ListNode[K, T]
func (*LinkedList[K, T]) Len ¶
func (ll *LinkedList[K, T]) Len() int
func (*LinkedList[K, T]) MoveToFront ¶
func (ll *LinkedList[K, T]) MoveToFront(node *ListNode[K, T])
func (*LinkedList[K, T]) PopBack ¶
func (ll *LinkedList[K, T]) PopBack() (*ListNode[K, T], error)
func (*LinkedList[K, T]) PopFront ¶
func (ll *LinkedList[K, T]) PopFront() (*ListNode[K, T], error)
func (*LinkedList[K, T]) Remove ¶
func (ll *LinkedList[K, T]) Remove(node *ListNode[K, T])
Click to show internal directories.
Click to hide internal directories.