It's one of the paradoxes of blogging that most every blogger (including myself) is sharing what they know right now (let's quietly ignore those who blog purely for traffic and visibility). Since everyone is learning, this can result in poor or misleading information being shared just as much as good information. Keep this in mind as you read any blog - how experienced is the writer and how well do they really know what they're talking about.
I'm just as flawed as other bloggers, so you should feel encouraged to check my ideas for yourself. Keep the date in mind as well - in our fast moving field, even good ideas can become obsolete.
As we did with our original immutable queue, we’ll define dedicated implementations of
IImmutablePriorityQueue<T> for handling empty and single item queues.
After exploring last time how to remove an item from a queue, let’s look at the slightly more complex case of adding items.
Before we can start on the actual implementation of our immutable priority queue, we need to understand the algorithms we’re going to use. There are two different scenarios to consider - when we enqueue something onto the queue, and when we dequeue the head.
As we did previously with our regular immutable queue, we should start by considering the design of our external interface - our API. How do we want our users to create and interact with our priority queue?
Recently, while working on a personal project, I needed a priority queue. Instead of slamming all of the items into a sorted list and making do, I decided to do the job properly and write a proper abstraction. To keep things interesting, it was an immutable implementation.
|Equality in .NET||7|
|Immutable Priority Queues||5|
|Killing the Utility Class||5|
|Instance validation in C#||12|
|A better approach to reflection||13 Oct 2018|
|Avoiding Magic Strings||06 Oct 2018|
|Capturing Validation Metadata||29 Sep 2018|
|Modelling Validation Metadata||22 Sep 2018|
|Validation Metadata||15 Sep 2018|
|Extending validation with warnings||08 Sep 2018|
|Bootstrapping a Psake build||01 Sep 2018|
|Validation recap||25 Aug 2018|
|Equality of validation||18 Aug 2018|
|Short-circuiting validation||11 Aug 2018|
|Aggregation of validation||04 Aug 2018|
|Recovery of validation types||28 Jul 2018|
|Basic validation||21 Jul 2018|
|Default includes and excludes for csproj||14 Jul 2018|
|Why we need better validation||07 Jul 2018|
|A question of struct performance||30 Jun 2018|
|Solving my Assembly Load Issues||23 Jun 2018|
|Troubleshooting Assembly Load Issues with the MSBuild Structured Log Viewer||16 Jun 2018|
|Troubleshooting Assembly Loading with the Assembly Binding Log Viewer||09 Jun 2018|
|Sharpen The Saw #37||04 Jun 2018|
|Converting projects to new csproj||02 Jun 2018|
|Avoid hardcoded wait times||26 May 2018|
|Sharpen The Saw #36||21 May 2018|
|Guaranteed Progression||19 May 2018|
|Always fix it twice||12 May 2018|
|Even longer than that||05 May 2018|
|Sharpen The Saw #35||30 Apr 2018|
|A simple fix takes longer than you think||28 Apr 2018|
|Sharpen The Saw #34||23 Apr 2018|
|How long is a simple fix?||21 Apr 2018|