Monthly Archives: March 2013

Use branch and bound to recursively find the highest value path through a two-dimensional array of numbers in C#

(This method is similar to one that is described on my forthcoming book A Practical Introduction to Computer Algorithms. I’ll post more about it later when it’s closer to publication.) The examples Recursively find the highest value path through a … Continue reading

Posted in algorithms, mathematics | Leave a comment

Recursively find the highest value path through a two-dimensional array of numbers in C#

(This method is similar to one that is described on my forthcoming book A Practical Introduction to Computer Algorithms. I’ll post more about it later when it’s closer to publication.) Look at the picture on the right. The goal is … Continue reading

Posted in algorithms, mathematics | Leave a comment

Save Excel data in a PDF file in C#

This example extends the example Write data into an Excel workbook in C#. See that example for information on how to open an Excel workbook, write data into it, and save it. Note that before you can use the Excel … Continue reading

Posted in Excel, Office | 1 Comment

Load a cursor from a resource in C#

Sometimes it’s useful to use a non-standard cursor in a program. This example explains how you can load a cursor from a cursor file included as a project resource. To add a cursor file to the project’s resources, open the … Continue reading

Posted in files, graphics | Leave a comment

Use the Stopwatch class to time a program in C#

I often save the time with DateTime.Now and then compare it to a later time to see how much time has elapsed. The System.Diagnostics.Stopwatch class makes this a bit easier. It’s Start method essentially makes the object record the current … Continue reading

Posted in performance | Leave a comment

Use the BigInteger structure in C#

The long data type can hold values between roughly -9.2 x 1018 and -9.2 x 1018, bit sometimes even that range isn’t big enough. The .NET Framework 4.0 introduced the BigInteger structure to represent integer values of arbitrary size. To … Continue reading

Posted in mathematics | Leave a comment