Length of an SLIst ?
Andrej Mitrovic
andrej.mitrovich at gmail.com
Mon Apr 2 14:10:40 PDT 2012
On 4/2/12, Justin Whear <justin at economicmodeling.com> wrote:
> Classic singly-linked lists must be iterated to determine length
I'm no algorithms buff, but I don't understand the benefit of not
storing the length in the SList. What does it cost to maintain an
extra variable? It's a single increment/decrement on each add/remove
and a little bit of memory to store the count.
More information about the Digitalmars-d-learn
mailing list