Decimal to Binary
excerpt: This covers iterative and recursive implementation of constructing base 2 expansions. tags: modulooperator reduceinputvalue tailrecursion
The basic building blocks such as modulus, reduce input and tail recursion is discussed in this article.
Iterative Implementation
Constructing Base 2 Expansions
A decimal number 𝑛 requires approximately log2 𝑛 bits for its binary representation.


Building Blocks
 Modulus
 Reduce Input
Recursive Implementation
The recursive implementation for constructing base 2 expansions:


Building Block
 Tail Recursion