how should I implement this list?

Bedros 2bedros at gmail.com
Fri Jun 14 22:05:43 PDT 2013


I'm converting some  code into D while learning D and need some 
help to implement this


I have a node of struct { ulong mask; ulong value};

now I need to create a list and insert that node; but first I 
don't need duplicates, so, I first check if node already exists 
in list.

I also need to traverse the list, and remove a node

currently I'm using dynamic array in D, but it's not efficient; 
is there a better way to do the following

insert with no duplicates
remove
traverse
find

I read about containers in D, but the documentation is confusing; 
and not sure if container implementation is mature.

BTW, my code will generate 100s of millions of nodes, and each 
node on average is used once or twice then removed

I'll appreciate it if someone points me to some examples or 
documentation of a feature in D.

Thanks in advance

Bedros


More information about the Digitalmars-d-learn mailing list