Search Results for

    Show / Hide Table of Contents

    Interface IStack<T>

    Defines the interface common to all Stack implementations for items of type T.

    Namespace: MoreStructures.Stacks
    Assembly: MoreStructures.dll
    Syntax
    public interface IStack<T>
    Type Parameters
    Name Description
    T

    The type of items, the stack is composed of.

    Remarks

    DEFINITION
    - A Stack is a data structure storing items of a generic type T in a LIFO (Last In First Out) fashion.
    - Items are both inserted and extracted at the top (or begin) of the stack.
    - Unlike array lists, general random access doesn't come as a easy, performant operation.
    - Because data insertion and extraction at a single specific spot is priviledged over any other position in the data structure, O(1) non amortized cost of insertion and extraction can be provided in some implementations.
    - However, arrays and array lists can be used as a backing structure for a stack, and still have O(1) amortized cost within array boundaries and O(1) amortized cost to remove array boundaries constraints.
    - Items are in a total order relationship and duplicates are supported.

    Properties

    | Improve this Doc View Source

    Count

    The number of items currently in the stack.

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

    Methods

    | Improve this Doc View Source

    Peek()

    Returns the item on top of the stack, without popping it out from the stack.

    Declaration
    T Peek()
    Returns
    Type Description
    T

    The item of type T currently on top of the stack.

    | Improve this Doc View Source

    Pop()

    Pops the item out from the top of the stack and returns it as a result.

    Declaration
    T Pop()
    Returns
    Type Description
    T

    The item of type T which was on top of the stack.

    Remarks

    The item which was on second position at the top of the stack goes on the top after the item on top is popped out.

    | Improve this Doc View Source

    Push(T)

    Push the provided item onto the top of the stack.

    Declaration
    void Push(T item)
    Parameters
    Type Name Description
    T item

    The item of type T to be pushed.

    Remarks

    The item which was on top of the stack before this push is pushed down onto second position.

    Extension Methods

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