13 people like it.
Like the snippet!
This code sample generates Pascal's triangle as jagged 2D list (list of lists). It takes 0.5 sec to generate 3000 rows (vs 16 sec for http://fssnip.net/23). Tip: try to avoid of using "list1 @ list2" construction.
1: 2: 3: 4: 5: 6: 7: 8: 9: |
|
Link: | http://fssnip.net/2b |
Posted: | 13 years ago |
Author: | Shamil Sayfutdinov |
Tags: | lists , jagged array , algorithms , learning f# |