linked list, ranges

bearophile bearophileHUGS at lycos.com
Sun Sep 26 04:53:06 PDT 2010


Joel Christensen:

> Thanks again for the reply Jonathan. I'm using doublely linked list I 
> made for a game where ships and there lazer bolts are in the same list. 
> Without linked list I couldn't do things like create a lazer bolt or 
> remove one while trans-versing the linked list. I had to use my own 
> linked list, having a next and prev node in each object that goes in the 
> list.

I am looking for use cases of singly|doubly linked lists, I (nearly) never need them in my code. Few questions:
1) What's a typical (or average) length of your list?
2) Are items sorted (like from the bigger to the smaller one)?
3) Is the item order important (so is it OK to shuffle them in some other ways)?
4a) How often/many do you need to add items to the list?
4b) How often/many do you need to remove items to the list?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list