Pascal's triangle: Difference between revisions

Content added Content deleted
Line 329: Line 329:
However, this solution is horribly inefficient (O(''n''**2)). It slowly grinds to a halt on a reasonably powerful PC after about line 25 of the triangle.
However, this solution is horribly inefficient (O(''n''**2)). It slowly grinds to a halt on a reasonably powerful PC after about line 25 of the triangle.


Test program:
Program for unformatted output:
<lang groovy>def count = 15
<lang groovy>def count = 15
(1..count).each { n ->
(1..count).each { n ->