Class DoublyLinkedList<T>
A doubly linked list implementation.
Inheritance
DoublyLinkedList<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class DoublyLinkedList<T> : IEnumerable<T>, IEnumerable
Type Parameters
Fields
Head
Declaration
public DoublyLinkedListNode<T> Head
Field Value
Tail
Declaration
public DoublyLinkedListNode<T> Tail
Field Value
Methods
Clear()
Declaration
Delete(T)
Declaration
public void Delete(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
Delete(DoublyLinkedListNode<T>)
Delete the given node.
Time complexity: O(n).
Declaration
public void Delete(DoublyLinkedListNode<T> node)
Parameters
DeleteFirst()
Declaration
Returns
DeleteLast()
Delete tail node.
Time complexity: O(1)
Declaration
Returns
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
InsertAfter(DoublyLinkedListNode<T>, DoublyLinkedListNode<T>)
Insert right after this node.
Time complexity: O(1).
Declaration
public DoublyLinkedListNode<T> InsertAfter(DoublyLinkedListNode<T> node, DoublyLinkedListNode<T> data)
Parameters
Returns
InsertBefore(DoublyLinkedListNode<T>, DoublyLinkedListNode<T>)
Insert right before this node.
Time complexity:O(1).
Declaration
public DoublyLinkedListNode<T> InsertBefore(DoublyLinkedListNode<T> node, DoublyLinkedListNode<T> data)
Parameters
Returns
InsertFirst(T)
Declaration
public DoublyLinkedListNode<T> InsertFirst(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
Returns
InsertLast(T)
Declaration
public DoublyLinkedListNode<T> InsertLast(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
Returns
IsEmpty()
Declaration
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements