>> > next sibling to return the result. Without that optimization the time
>> > spent
>> > iterating over the NodeList would be O(n^2) instead of linear.
>>
>> Ah ok, so there is some saved state going on.  Next question, what
>> makes iterating over the list n-squared?
>
> It's a linked list which the user is indexing into. Without the cache you
> have to either start from the beginning or the end of the list every time to
> find the Node and over a for loop that ends up being n-squared.

Thanks for the replies, all very interesting to know.




-- 
Andrew Welch
http://andrewjwelch.com

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to