Spot the defect: Bad comparisons, part one

The mutable List<T> class provides an in-place sort method which can take a comparison delegate. It’s quite handy to be able to sort a list into order by being able to compare any two elements, but you have to make sure you get it right. First off, what are the requirements of the comparison delegate?…


Revenge of The Cycle Detector

Mike Schinkel takes even longer to get to the point than I do, and that’s saying something!  Mike tells a long story about another application of partial order sorts, and asks how to modify the partial order sort algorithm so that it has a new property.  Namely, in addition to returning a list ordered such…


Attack of the Undead Cycle Detector

My old friend Rob made some comments on yesterday’s post which deserve to be called out: Consider a software application that is extensible with plug-ins. If some of the plug-ins are dependent on others, then a partial sort is required to determine the order in which they are loaded so that errors can be prevented….


I’m Putting On My Top Hat, Tying Up My White Tie, Brushing Out My Tails — In That Order

I thought I might blog briefly on an interesting algorithm which can be implemented very elegantly in JScript, but a lot of scripters don’t know about. Most scripters know about the sort method on the Array prototype — you give it an array and (optionally) a comparison function, and it sorts the array so that every element…