> That's one. Now, suppose you're iterating through a List and decide to
> remove the current entry (or insert a new entry before the current one.)
> The cost is linear for the ArrayList but fixed for the LinkedList.
>> That's one. Now, suppose you're iterating through a List and decide to
>> remove the current entry (or insert a new entry before the current one.)
>> The cost is linear for the ArrayList but fixed for the LinkedList.
>
> Can you please more describe the work Linear in your answer "The cost
> is linear..." .
I was copying your use of the word. Anyway, I meant proportonal to the size
of the array.
Mike Schilling wrote (and thus should be attributed):
>> That's one. Now, suppose you're iterating through a List and decide to
>> remove the current entry (or insert a new entry before the current one.)
>> The cost is linear for the ArrayList but fixed for the LinkedList.
> Can you please more describe the work Linear [sic] in your answer "The cost
> is linear..." .
Polynomial of order 1.
For example, the function "f(x) = mx + k" is linear in x because it scales as
the first power of x.
"f(x) = ax^2 + bx + c" is quadratic, i.e., it scales as the second power of x.
<http://en.wikipedia.org/wiki/Linear_equation>
<http://en.wikipedia.org/wiki/Quadratic>
The context for these terms here is /asymptotic analysis/, the analysis of a
problem for its limiting characteristics. The limit of growth rate with the
size of the input is a major analytical datum.
<http://en.wikipedia.org/wiki/Big_O_notation>
For an x-fold increase in problem size (e.g., the length of a List), the time
(or other metric of effort) to solve the problem will increase by some
function of x, f(x). If f(x) doesn't change with the problem size, it's of
order 0. If it increases in direct proportion to x, it's linear. If it
increases proportionate to the square of x, it's quadratic, and so on.
There is a lot of study time in your near future. GIYF.

Signature
Lew