asm_book/section_3/precomputation
2024-04-12 13:27:44 -05:00
..
main.c begun precomputation chapter 2024-04-12 13:27:44 -05:00
README.md begun precomputation chapter 2024-04-12 13:27:44 -05:00

Section 3 - Pre-computation

Time versus space.

This is the essential battle that programmers face. In order to go faster, more memory is used. In order to economize on memory, more computation is needed.

This duality is demonstrated in no better way than comparing a calculated method (economizing space at the expense of time) versus an entirely precomputed method (sacrificing space to reduce time).

In this section, we will demonstrate three methods of calculating factorials from 0 to 15.

  • Iteratively

  • Recursively

  • By pre-computation

Certainly, for the purposes of this demonstration, it is not necessary to implement both iterative and recursive methods. We do so for fun and for any lessons the reader can glean.