Unageek.Collections.Deque 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Unageek.Collections.Deque --version 1.0.0
NuGet\Install-Package Unageek.Collections.Deque -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Unageek.Collections.Deque" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Unageek.Collections.Deque --version 1.0.0
#r "nuget: Unageek.Collections.Deque, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Unageek.Collections.Deque as a Cake Addin
#addin nuget:?package=Unageek.Collections.Deque&version=1.0.0

// Install Unageek.Collections.Deque as a Cake Tool
#tool nuget:?package=Unageek.Collections.Deque&version=1.0.0

nuget build

Deque<T>

Deque<T> is a .NET implementation of double-ended queue.

using Unageek.Collections;

var queue = new Deque<string>();
queue.AddLast("one");
queue.AddLast("two");
queue.AddLast("three");

var stack = new Deque<string>();
stack.AddFirst("three");
stack.AddFirst("two");
stack.AddFirst("one");

Console.WriteLine(queue.SequenceEqual(stack)); // True

Features

  • Drop-in replacement for List<T>

    Deque<T> implements the same interfaces, methods, and properties as List<T>, including random access, bulk insertion/removal, and binary search.

  • Performance

    Random insertion and removal are expected to be twice as fast as List<T>.

  • Additional methods

    Deque<T> also provides the following methods:

    • void AddFirst(T item) (equivalent to Add)
    • void AddLast(T item)
    • void RemoveFirst()
    • void RemoveLast()
    • T PeekFirst()
    • T PeekLast()
    • T PopFirst()
    • T PopLast()
    • bool TryPeekFirst(out T item)
    • bool TryPeekLast(out T item)
    • bool TryPopFirst(out T item)
    • bool TryPopLast(out T item)

Limitations

  • The maximum number of elements a Deque<T> can hold is 2<sup>30</sup> = 1,073,741,824. If you try to add more items, an OutOfMemoryException is thrown.

  • The capacity of a Deque<T> can only be zero or a power of two (up to 2<sup>30</sup>).

  • Serialization is not supported.

Supported .NET Versions

.NET 6+ is supported.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 531 8/7/2022
1.0.0-rc.1 90 8/7/2022
1.0.0-rc.0 96 8/5/2022