Show / Hide Table of Contents

    Class SinglyLinkedList<T>

    A singly linked list implementation.

    Inheritance
    Object
    SinglyLinkedList<T>
    Namespace: Advanced.Algorithms.DataStructures
    Assembly: Advanced.Algorithms.dll
    Syntax
    public class SinglyLinkedList<T> : IEnumerable<T>
    Type Parameters
    Name Description
    T

    Fields

    Head

    Declaration
    public SinglyLinkedListNode<T> Head
    Field Value
    Type Description
    SinglyLinkedListNode<T>

    Methods

    Clear()

    Declaration
    public void Clear()

    Delete(T)

    Delete given element. Time complexity: O(n)

    Declaration
    public void Delete(T element)
    Parameters
    Type Name Description
    T element

    DeleteFirst()

    Time complexity: O(1).

    Declaration
    public T DeleteFirst()
    Returns
    Type Description
    T

    DeleteLast()

    Time complexity: O(n).

    Declaration
    public T DeleteLast()
    Returns
    Type Description
    T

    GetEnumerator()

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    IEnumerator<T>

    InsertFirst(T)

    Insert first. Time complexity: O(1).

    Declaration
    public void InsertFirst(T data)
    Parameters
    Type Name Description
    T data

    InsertFirst(SinglyLinkedListNode<T>)

    Inserts this element to the begining. Time complexity: O(1).

    Declaration
    public void InsertFirst(SinglyLinkedListNode<T> current)
    Parameters
    Type Name Description
    SinglyLinkedListNode<T> current

    InsertLast(T)

    Time complexity: O(n).

    Declaration
    public void InsertLast(T data)
    Parameters
    Type Name Description
    T data

    IsEmpty()

    Declaration
    public bool IsEmpty()
    Returns
    Type Description
    Boolean
    Back to top Generated by DocFX