Skip to content

Commit

Permalink
Fixed an inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
nbro committed Sep 30, 2017
1 parent 588da9f commit 2251951
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ands/algorithms/numerical/horner.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@
## Computing polynomials by implementing Horner's method
p(x₀), a u-degree polynomial, can computed efficiently using Horner's scheme, in
O(n) operations, as follows
O(u) operations, as follows
function HORNER({a₀, a₁, ..., aᵤ₋₁, aᵤ}, x₀):
p := aᵤ
for i from u − 1 to 0 by −1 do:
p := p * x₀ + aᵢ
return p
From the previous pseudo-code, we can easily see that this is a O(n) algorithm,
From the previous pseudo-code, we can easily see that this is a O(u) algorithm,
since we have u iterations of the for loop and provided that multiplications and
additions can be performed in O(1), w.r.t. u.
Expand Down

0 comments on commit 2251951

Please sign in to comment.