Implementation of Integer Partition Algorithm in C#

suggest change
public static class IntegerPartition
{
    public static long Count(int number, int largestPart)
    {
        if (number < 0)
            throw new System.ArgumentOutOfRangeException(nameof(number));
        if (largestPart < 0)
            throw new System.ArgumentOutOfRangeException(nameof(largestPart));

        var ways = new long[number + 1];
        ways[0] = 1;
        for (int part = 1; part <= System.Math.Min(number, largestPart); part++)
            for (int total = part; total <= number; total++)
                ways[total] = checked(ways[total] + ways[total - part]);

        return ways[number];
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents