BlueRaja / High-Speed-Priority-Queue-for-C-Sharp

A C# priority queue optimized for pathfinding applications
MIT License
1.15k stars 169 forks source link

Retrieve priority in Peek/Dequeue #27

Closed mat-pielat closed 7 years ago

mat-pielat commented 7 years ago

Sometimes the priority is a part of information. It would be nice to have overloaded First element lookup and Dequeue which let the user to retrieve it.

BlueRaja commented 7 years ago

In FastPriorityQueue, Priority is a property of the Node

In SimplePriorityQueue, you're correct that there is currently no way to do this. Good suggestion :+1:

mat-pielat commented 7 years ago

Sorry, I've only just downloaded your library via nuget and without looking at FastPriorityQueue assumed they have the same abstraction. You could add Priority to SimplePriorityQueue's nodes if that makes it any easier.

BlueRaja commented 7 years ago

Completed in v4.1.1 SimplePriorityQueue now has a GetPriority(TItem) method