To calculate power of a number

we can calculate power of a number in log n times by bitmasking then why we use linear recurrences to calculate power in logn time does there is any benefit of using linear recurrences please explain it

@sahudilip138 bitmasking approach , you can use too , its even better than recursive approach
refer this link


i hope its clear if yes dont forget to mark it as resolved and hit like :smiley:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.