C# algorithms and sample code inspired by textbooks and other sources