Pascal's Triangle generator
Whatâs Pascalâs Triangle? Thatâs what it is (Wikipedia has all the theory, if you need). Pascalâs Triangle first 6 rows The thing I wrote here is a generator of the n-th row of the triangle, that doesnât use more then the memory needed to store the solution. Instead of allocating a Triangular Matrix, and building every row based on the one above, solution is built in place. How does it work The result is generated âfilling the row from right to leftâ. I start initiating the element on the right hand side to â1â. Then, I run something like: ...