Professional Documents
Culture Documents
complexity (1)
Data structures and algorithms in
Java
3 Algorithm A
Algorithm B
time
(ms) 2
0
10 20 30 40 items to be sorted, n
y = y + 1; fetch + + + store
fetch -
Three operand fetches are required: the first to fetch a,
the base address of the array; the second to fetch i, the
index into the array; and, the third to fetch array element
a[i].
n
Example: Horners rule a x
i 1
i
i