You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When wanting to clear e.g. a FibonacciQueue there is as far as I can see no efficient way to do this.
An inefficient way is to repeatedly call dequeue until it is empty, but that causes unnecessary updates of the data structure to maintain the invariants for each call to Dequeue.
while(queue.Count>0)// Dispose all calculation items{_=queue.Dequeue();}
Describe the solution you'd like
BCL collection types like List<T> and Dictionary<TKey, TValue> have a Clear() method to empty them.
It would be nice for all/most QuikGraph collections to have a similar method.
If acceptable IQueue<T> and IDisjointSet<T> could have a void Clear() added, but that is technically a breaking change if any consumers have already implemented those interfaces.
Describe alternatives you've considered
Additional context
I'd be happy to do the implementation and testing of this.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When wanting to clear e.g. a
FibonacciQueue
there is as far as I can see no efficient way to do this.An inefficient way is to repeatedly call dequeue until it is empty, but that causes unnecessary updates of the data structure to maintain the invariants for each call to
Dequeue
.Describe the solution you'd like
BCL collection types like
List<T>
andDictionary<TKey, TValue>
have aClear()
method to empty them.It would be nice for all/most QuikGraph collections to have a similar method.
The ones I have seen missing a
Clear
are:BinaryQueue
,BinaryQueue
,FibonacciQueue
,FibonacciHeap
,FibonacciHeapLinkedList
ForestDisjointSet
If acceptable
IQueue<T>
andIDisjointSet<T>
could have avoid Clear()
added, but that is technically a breaking change if any consumers have already implemented those interfaces.Describe alternatives you've considered
Additional context
I'd be happy to do the implementation and testing of this.
The text was updated successfully, but these errors were encountered: