Documentation ¶
Index ¶
- type DllNode
- type DoublyLinkedList
- func (dll *DoublyLinkedList) InsertAfter(node, nodeToInsert *DllNode)
- func (dll *DoublyLinkedList) InsertBefore(node, nodeToInsert *DllNode)
- func (dll *DoublyLinkedList) Push(vertex *vertex.Vertex)
- func (dll *DoublyLinkedList) PushTail(vertex *vertex.Vertex)
- func (dll *DoublyLinkedList) Remove(node *DllNode)
- func (dll *DoublyLinkedList) Reset()
- func (dll *DoublyLinkedList) SetHead(node *DllNode)
- func (dll *DoublyLinkedList) SetTail(node *DllNode)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoublyLinkedList ¶
type DoublyLinkedList struct {
Head, Tail *DllNode
}
DoublyLinkedList is the node of DLL which is connected to the tail and the head
func NewDoublyLinkedList ¶
func NewDoublyLinkedList() *DoublyLinkedList
NewDoublyLinkedList returns DLL implementation
func (*DoublyLinkedList) InsertAfter ¶
func (dll *DoublyLinkedList) InsertAfter(node, nodeToInsert *DllNode)
InsertAfter inserts node after the provided node
func (*DoublyLinkedList) InsertBefore ¶
func (dll *DoublyLinkedList) InsertBefore(node, nodeToInsert *DllNode)
InsertBefore inserts node before the provided node
func (*DoublyLinkedList) Push ¶
func (dll *DoublyLinkedList) Push(vertex *vertex.Vertex)
Push used to push vertex to the head
func (*DoublyLinkedList) PushTail ¶
func (dll *DoublyLinkedList) PushTail(vertex *vertex.Vertex)
PushTail used to push vertex to the tail
func (*DoublyLinkedList) Remove ¶
func (dll *DoublyLinkedList) Remove(node *DllNode)
Remove removes the node
func (*DoublyLinkedList) SetHead ¶
func (dll *DoublyLinkedList) SetHead(node *DllNode)
SetHead O(1) time + space
func (*DoublyLinkedList) SetTail ¶
func (dll *DoublyLinkedList) SetTail(node *DllNode)
SetTail sets the tail, constant O(1) time and space
Click to show internal directories.
Click to hide internal directories.