Introduction to Algorithms 2nd edition implementation in C#