MinTL, SortedSet and searching

Paul Findlay r.lph50+d at gmail.com
Thu Jun 29 05:43:32 PDT 2006


Hello,

I'm new to programming and to D.

I 'inherited' some C code (a small library I want to port to D) that 
used an array to store in sorted order pointers to structs. I thought it 
would be nice fit for the MinTL SortedSet. But how does one go about 
doing a (<= O(n)) search on a MinTL SortedSet that returns a value? The 
value I would search using is a struct with only some of its members 
set. The opCmp on the struct allows for this. I'm using SortedSet.values 
but I'm balking at it..

Perhaps I should just keep using an array of pointers with reallocations 
and binary search. Or is there room in the MinTL for something else? Or 
am I missing something?

- Paul Findlay
P.S. I'm sorry if this is the wrong newsgroup..



More information about the Digitalmars-d-dtl mailing list