IndentedTextWriter

There’s a very useful class called IndentedTextWriter in the System.CodeDom.Compiler namespace that automatically adds whitespace before each line depending on its Indent property.  This works great when you have code with several nested (or recursive) subroutines and you want them to print nested output but you don’t want to keep track of how “nested” they…

1

PriorityQueue

I’m implementing a single-source multiple-target version of Dijkstra’s shortest path algorithm that stops when it reaches a requested number of targets.  In order to do this, I’m using a priority queue where target vertices are prioritized by shortest path weight, starting with the source.  The only problem is, the .NET framework doesn’t have a priority…

1