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
|
Improve this Doc
View Source
Head
Declaration
public DoublyLinkedListNode<T> Head
Field Value
|
Improve this Doc
View Source
Tail
Declaration
public DoublyLinkedListNode<T> Tail
Field Value
Methods
|
Improve this Doc
View Source
Clear()
Declaration
|
Improve this Doc
View Source
Delete(T)
Declaration
public void Delete(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
|
Improve this Doc
View Source
Delete(DoublyLinkedListNode<T>)
Delete the given node.
Time complexity: O(n).
Declaration
public void Delete(DoublyLinkedListNode<T> node)
Parameters
|
Improve this Doc
View Source
DeleteFirst()
Declaration
Returns
|
Improve this Doc
View Source
DeleteLast()
Delete tail node.
Time complexity: O(1)
Declaration
Returns
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
|
Improve this Doc
View Source
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
|
Improve this Doc
View Source
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
|
Improve this Doc
View Source
InsertFirst(T)
Declaration
public DoublyLinkedListNode<T> InsertFirst(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
Returns
|
Improve this Doc
View Source
InsertLast(T)
Declaration
public DoublyLinkedListNode<T> InsertLast(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
Returns
|
Improve this Doc
View Source
IsEmpty()
Declaration
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements