Pents.SortedList 1.0.0

dotnet add package Pents.SortedList --version 1.0.0                
NuGet\Install-Package Pents.SortedList -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="Pents.SortedList" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pents.SortedList --version 1.0.0                
#r "nuget: Pents.SortedList, 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 Pents.SortedList as a Cake Addin
#addin nuget:?package=Pents.SortedList&version=1.0.0

// Install Pents.SortedList as a Cake Tool
#tool nuget:?package=Pents.SortedList&version=1.0.0                

Sorted List using AVL Tree

This repository contains an implementation of a sorted list in C# using an AVL tree data structure. The SortedList<T> class provides efficient Add and Remove operations with O(log n) time complexity, where n is the number of elements in the list.

Features

  • Generic type support, allowing you to store any type that implements the IComparable<T> interface.
  • Efficient Add and Remove operations with O(log n) time complexity.
  • Simple and clean API for managing a sorted list.

Usage

To use the SortedList<T> class, simply create an instance and call the Add and Remove methods to insert and delete elements.

Copy code
SortedList<int> sortedList = new SortedList<int>();

sortedList.Add(9);
sortedList.Add(5);
sortedList.Add(10);
sortedList.Add(0);
sortedList.Add(6);
sortedList.Add(11);
sortedList.Add(-1);
sortedList.Add(1);
sortedList.Add(2);

// The sorted list now contains: -1, 0, 1, 2, 5, 6, 9, 10, 11

sortedList.Remove(10);

// The sorted list now contains: -1, 0, 1, 2, 5, 6, 9, 11

Interface ISortedList implements IEnumerable<T> - so you can use LINQ methods

int[] sortedArray = sortedList.ToArray();

Installation

To use the SortedList<T> class in your project, copy the SortedList.cs file into your project directory and add it to your project.

Contributing

If you'd like to contribute to this project, feel free to submit a pull request. We welcome any improvements or bug fixes you'd like to share.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

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 is compatible.  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.

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 203 3/20/2023