Search Results for

    Show / Hide Table of Contents

    Class LinkedListQueue<T>

    A IQueue<T> implementation based on a singly-linked linked list of items.

    Inheritance
    System.Object
    LinkedListQueue<T>
    Implements
    IQueue<T>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: MoreStructures.Queues
    Assembly: MoreStructures.dll
    Syntax
    public class LinkedListQueue<T> : IQueue<T>
    Type Parameters
    Name Description
    T

    Remarks

    ADVANTAGES AND DISADVANTAGES
    - The advantages and disadvantages of using a linked list over an array-based implementation are the same as the ones described in LinkedListStack<T>.

    Properties

    | Improve this Doc View Source

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32
    Remarks

    Stored and updated in constant time at each Enqueue(T) and Dequeue().
    Time and Space Complexity are O(1).

    Methods

    | Improve this Doc View Source

    Dequeue()

    Declaration
    public T Dequeue()
    Returns
    Type Description
    T
    Remarks

    First, it retrieves the item referenced by the front of the underlying linked list.
    Then it updates the reference to the head of the linked list, to point to its "next". The reference to the last item is also updated, if the head is set to point to null.
    Time and Space Complexity are O(1).

    | Improve this Doc View Source

    Enqueue(T)

    Declaration
    public void Enqueue(T item)
    Parameters
    Type Name Description
    T item
    Remarks

    Creates a new node wrapping the provided item.
    Then, it appends it to the back of the linked list of items, updating the reference to the last item of the list.
    It also updates the head, if the list was previously empty, to point to the newly created item.
    Time and Space Complexity are O(1).

    | Improve this Doc View Source

    Peek()

    Declaration
    public T Peek()
    Returns
    Type Description
    T
    Remarks

    Checks the front of the underlying linked list.
    Time and Space Complexity are O(1).

    Implements

    IQueue<T>

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX