javascript-algorithms
javascript-algorithms copied to clipboard
fix(fastPowering): check when number is raided to power of one
The function didnt check when power is one so unnecessarily was going though multiplying base by ones
This type of benchmark is usually not a good measurement for practical usage. More importantly, this type of "optimization" is not the goal of this repository -- it's about understanding data structures and algorithms, not squeezing out every nanosecond from the engine.