Skip to content

Latest commit

 

History

History
executable file
·
12 lines (7 loc) · 251 Bytes

File metadata and controls

executable file
·
12 lines (7 loc) · 251 Bytes

题目

Implement pow(x, n).

解题思路

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

总结

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