Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Files

Latest commit

0120d35 · Mar 14, 2018

History

History

0050.powx-n

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 20, 2017
Mar 14, 2018
Mar 14, 2018

题目

Implement pow(x, n).

解题思路

注意到指数是整数,所以,可以利用乘法计算幂

总结

o(N)的算法会浪费很多时间,o(lgN)的算法要快的多。