Board index » delphi » Pascal triangle
Bob Schor
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Pascal triangleQuoteEsky wrote: directly above, but don't understand why you need to know about 2-D arrays. Suppose I reformulate the problem slightly. I'll define "PascalTriangle (row, column)" as the number in row, column, with the rules that column <= row, both are >= 1, the outer entries are all 1, and the rule you state applies. I maintain that if you code this directly as a function (it will be recursive, of course), you'll get an extremely simple, actually quite fast, expression for Pascal's Triangle. [As a side benefit, for larger numbers of rows and columns, it won't have the danger of overflows that a naive implementation of the factorial method might exhibit]. Bob Schor |