Class SinglyLinkedList<T>
A singly linked list implementation.
Inheritance
SinglyLinkedList<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class SinglyLinkedList<T> : IEnumerable<T>, IEnumerable
Type Parameters
Fields
|
Improve this Doc
View Source
Head
Declaration
public SinglyLinkedListNode<T> Head
Field Value
Methods
|
Improve this Doc
View Source
Clear()
Declaration
|
Improve this Doc
View Source
Delete(T)
Delete given element.
Time complexity: O(n)
Declaration
public void Delete(T element)
Parameters
Type |
Name |
Description |
T |
element |
|
|
Improve this Doc
View Source
DeleteFirst()
Declaration
Returns
|
Improve this Doc
View Source
DeleteLast()
Declaration
Returns
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
|
Improve this Doc
View Source
InsertFirst(T)
Insert first. Time complexity: O(1).
Declaration
public void InsertFirst(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
|
Improve this Doc
View Source
InsertFirst(SinglyLinkedListNode<T>)
Inserts this element to the begining.
Time complexity: O(1).
Declaration
public void InsertFirst(SinglyLinkedListNode<T> current)
Parameters
|
Improve this Doc
View Source
InsertLast(T)
Declaration
public void InsertLast(T data)
Parameters
Type |
Name |
Description |
T |
data |
|
|
Improve this Doc
View Source
IsEmpty()
Declaration
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements