Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
November 28, 2011 What about sets? | ||||
---|---|---|---|---|
| ||||
Attachments:
| In c++ there are a lot of data structs (vector, hashmap, ...) defined by stl. I need something similar to c++ "set" in D. Does it exists? I don't care about order of items, but I need a fast search and a easy way to iterate. A tree-like struct... |
November 28, 2011 Re: What about sets? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | On Monday, November 28, 2011 11:48:28 Andrea Fontana wrote: > In c++ there are a lot of data structs (vector, hashmap, ...) defined by > stl. I need something similar to c++ "set" in D. Does it exists? > I don't care about order of items, but I need a fast search and a easy > way to iterate. A tree-like struct... http://d-programming-language.org/phobos/std_container.html#RedBlackTree - Jonathan M Davis |
November 28, 2011 Re: What about sets? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis Attachments:
| Thank you! I didn't check for "std.container" module :)
Il giorno lun, 28/11/2011 alle 02.55 -0800, Jonathan M Davis ha scritto:
> On Monday, November 28, 2011 11:48:28 Andrea Fontana wrote:
> > In c++ there are a lot of data structs (vector, hashmap, ...) defined by
> > stl. I need something similar to c++ "set" in D. Does it exists?
> > I don't care about order of items, but I need a fast search and a easy
> > way to iterate. A tree-like struct...
>
> http://d-programming-language.org/phobos/std_container.html#RedBlackTree
>
> - Jonathan M Davis
|
November 28, 2011 Re: What about sets? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | On Monday, November 28, 2011 12:09:45 Andrea Fontana wrote:
> Thank you! I didn't check for "std.container" module :)
I should warn you that std.container a bit sparse at the moment, but RedBlackTree does give you a set (or a sorted map with the appropriate comparator function).
- Jonathan M Davis
|
November 29, 2011 Re: What about sets? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis Attachments:
| I was thinking to implement a redblack tree by myself so it's perfect!
Il giorno lun, 28/11/2011 alle 08.44 -0800, Jonathan M Davis ha scritto:
> On Monday, November 28, 2011 12:09:45 Andrea Fontana wrote:
> > Thank you! I didn't check for "std.container" module :)
>
> I should warn you that std.container a bit sparse at the moment, but RedBlackTree does give you a set (or a sorted map with the appropriate comparator function).
>
> - Jonathan M Davis
|
November 29, 2011 Re: What about sets? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | Also take a look at dcollections 2.0: http://www.dsource.org/projects/dcollections (the d2 branch). I think RBT was derived from there by Steven himself. Or maybe I'm thinking of another structure. |
Copyright © 1999-2021 by the D Language Foundation