#Recursion Power Function Using Recursion | Data Structures & #Algorithms | #Python

preview_player
Показать описание
Calculate Power Using Recursion | Data Structures & Algorithms | Python

Best Videos For Learning Python Tutorials:

Follow Me On Social Media

#power #recursion #netsetos
Рекомендации по теме
Комментарии
Автор

Omg
Fast power algorithm with a time complexity of log n .

popcorntimes
Автор

There is a correction in the logic
Res*Res will. Give wrong answer because for ex:
2**4
Res will store 2 * (2**2)
Which is 8 and Res *Res is 8*8 will give 64
Which is wrong answer for 2**4
Instead of Res = X*pow(X, n/2)
And returning Res *Res
Keep Res = pow(X, n/2)*pow(X, n/2)
And just return Res which will give you right answer that is 32 if you think I am wrong please check once

heartbeats
Автор

wow man...made my life..
Nice one Subscribed...Keep'em comin....

ShinyArjunSingh