Ex6 5

$\def\abs#1{|#1|}\def\i{\mathbf {i}}\def\ket#1{|{#1}\rangle}\def\bra#1{\langle{#1}|}\def\braket#1#2{\langle{#1}|{#2}\rangle}\def\tr{\mathord{\mbox{tr}}}\mathbf{Exercise\ 6.5}$

Show how to construct an efficient reversible circuit for every classical circuit along the lines of the construction of section 6.2.2 but without the assumption that $t$ is a power of $2$. Give the time and space bounds for your construction.