KonkurStudy
همه کارت‌ها

Exponentiation by Squaring (computing x^n in Theta(log n))

Computing xnx^{n} with the four basic operations needs only Θ(log⁡n)\Theta(\log n) multiplications, not Θ(n)\Theta(n): repeatedly square the base while halving the exponent, multiplying in an extra xx whenever a bit of nn is 11.

کارت الگوریتم کنکور ارشد علوم کامپیوتر