Show / Hide Table of Contents

Class StackLinked<T>

Implements a First-In-Last-Out stack data structure using a linked list.

Inheritance
System.Object
StackLinked<T>
Implements
IStack<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<T>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<StackLinked<T>>
Namespace: Towel.DataStructures
Assembly: Towel.dll
Syntax
public class StackLinked<T> : object, IStack<T>, IDataStructure<T>, ISteppable<T>, System.Collections.Generic.IEnumerable<T>, DataStructure.ICountable, DataStructure.IClearable, ICloneable<StackLinked<T>>
Type Parameters
Name Description
T

The generic type within the structure.

Constructors

| Improve this Doc View Source

StackLinked()

Constructs a new stack.

Declaration
public StackLinked()

Properties

| Improve this Doc View Source

Count

Gets the current count of the data structure.

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

Methods

| Improve this Doc View Source

Clear()

Returns the data structure to an empty state.

Declaration
public void Clear()
| Improve this Doc View Source

Clone()

Clones a T.

Declaration
public StackLinked<T> Clone()
Returns
Type Description
StackLinked<T>

A clone of the T.

| Improve this Doc View Source

GetEnumerator()

Declaration
public System.Collections.Generic.IEnumerator<T> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<T>
| Improve this Doc View Source

Peek()

Returns the most recent addition to the stack.

Declaration
public T Peek()
Returns
Type Description
T

The most recent addition to the stack.

| Improve this Doc View Source

Pop()

Removes and returns the most recent addition to the stack.

Declaration
public T Pop()
Returns
Type Description
T

The most recent addition to the stack.

| Improve this Doc View Source

Push(T)

Adds an item to the top of the stack.

Declaration
public void Push(T addition)
Parameters
Type Name Description
T addition
| Improve this Doc View Source

StepperBreak<TStep>(TStep)

Traverses values and invokes a function on every T value.

Declaration
public StepStatus StepperBreak<TStep>(TStep step = default(TStep))
    where TStep : struct, IFunc<T, StepStatus>
Parameters
Type Name Description
TStep step

The function to invoke on every T value.

Returns
Type Description
StepStatus

The status of the traversal.

Type Parameters
Name Description
TStep

The type of function to invoke on every T value.

| Improve this Doc View Source

ToArray()

Constructs an array with the values of this data structure.

Declaration
public T[] ToArray()
Returns
Type Description
T[]

An array with the values of this data structure.

Implements

IStack<T>
IDataStructure<T>
ISteppable<T>
System.Collections.Generic.IEnumerable<>
DataStructure.ICountable
DataStructure.IClearable
ICloneable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX