Comments (4)
I'm not sure if there's a more efficient way to do this with a heap priority queue. What is the use-case for this?
from high-speed-priority-queue-for-c-sharp.
Applications that I can think of are search results, machine learning, search space limiting w/ path finding. Basically anywhere you need the top scored results.
Am I missing something. I would think that this wouldnt need anything more than just an Array.Clear on the latter part & to change the value of _numNodes?
from high-speed-priority-queue-for-c-sharp.
It's implemented as an array, but it's not a sorted array. Heaps are not search-trees, they only satisfy the heap property. The front of the queue is always the root node, but there is no way (to my knowledge) to find the end of the queue, aside from scanning all the leaf-nodes (~n/2 = O(n)
)
from high-speed-priority-queue-for-c-sharp.
I'm going to close this given that I don't know how to implement it more efficiently than creating a new priority queue. If you figure something out, please reopen and comment.
from high-speed-priority-queue-for-c-sharp.
Related Issues (20)
- Typo HOT 1
- Reused nodes QueueIndex breaks debug HOT 2
- Upgrade PCL project to .NET Standard Class Library HOT 1
- DLL Can't be found HOT 2
- NUnit tests do not run in debug in Visual Studio 2019 HOT 1
- Documentation contradicts examples HOT 2
- Assembly name has a space in it. HOT 2
- FastQueue doesn't return some nodes in some cases HOT 3
- Add constructor accepting FastPriorityQueue's backing array to minimize allocation HOT 1
- Thread safety HOT 1
- is it necessary to have restriction for IComparable? HOT 2
- Add strong name to this NuGet HOT 2
- Proposal: SimplePriorityQueue overloads that expose priority when trivial, for performance and thread safety HOT 1
- StablePriorityQueue is not stable. HOT 1
- Proposal: Add Targets for Other .NET Runtimes Explicitly HOT 2
- Look into C# 10 INumber interface
- Dequeue Performance HOT 3
- Dequeue of FastPriorityQueue returned in wrong order HOT 2
- Add OrderedEnumerator function
- Bug: Last item in queue is not in correct order HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from high-speed-priority-queue-for-c-sharp.