https://github.com/danielearwicker/priorityqueuemergesort
https://github.com/danielearwicker/priorityqueuemergesort
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/danielearwicker/priorityqueuemergesort
- Owner: danielearwicker
- License: apache-2.0
- Created: 2024-04-20T08:55:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T10:13:41.000Z (about 2 years ago)
- Last Synced: 2025-01-25T18:43:15.469Z (over 1 year ago)
- Language: C#
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PriorityQueueMergeSort
Test program for `PqSortedMerge`, alternative implementation of [SuperLinq](https://github.com/viceroypenguin/SuperLinq)'s `SortedMerge`.
Created by copying the `IEnumerable` and `IAsyncEnumerable` extension methods from SuperLinq, renaming them with the prefix `Pq`, and replacing the `Impl` with one that uses the CLR's `PriorityQueue` class.
Later extended to test (in non-async versions only):
- `SortedSet` - `SortedSet`, but the items have to be unique, so it's actually `SortedSet>` to hold multiple items with the same key.
- `SortedList` - `List` using linear search to find insertion point (does lots of key comparison for insertion, also has to copy array elements to insert/remove)
- `SortedLinked` - `LinkedList`, still using linear search but avoiding copying
- `BinarySortedArray` - Uses an array to get built-in `Array.BinarySearch` for fast insertion with ($log_2$) key comparisons
- `BinarySortedLinked` - Linked list with an adapted binary search to allow skipping through list nodes while avoiding key comparisons
Run all benchmarks with:
dotnet run -c Release -- -f '*' --join