|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
digitalmars.D.dtl - MinTL, SortedSet and searching
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.. Jun 29 2006
"Paul Findlay" <r.lph50+d gmail.com> wrote in message news:e80htr$2jtd$1 digitaldaemon.com...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.. Jul 05 2006
|