digitalmars.D.learn - What about sets?
- Andrea Fontana (4/4) Nov 28 2011 In c++ there are a lot of data structs (vector, hashmap, ...) defined by
- Jonathan M Davis (3/7) Nov 28 2011 http://d-programming-language.org/phobos/std_container.html#RedBlackTree
- Andrea Fontana (3/12) Nov 28 2011 y
- Jonathan M Davis (5/6) Nov 28 2011 I should warn you that std.container a bit sparse at the moment, but
- Andrea Fontana (3/11) Nov 29 2011 =20
- Andrej Mitrovic (4/4) Nov 29 2011 Also take a look at dcollections 2.0:
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...
Nov 28 2011
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
Nov 28 2011
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:yIn c++ there are a lot of data structs (vector, hashmap, ...) defined b=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...=20 http://d-programming-language.org/phobos/std_container.html#RedBlackTree =20 - Jonathan M Davis
Nov 28 2011
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
Nov 28 2011
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:=20Thank you! I didn't check for "std.container" module :)=20 I should warn you that std.container a bit sparse at the moment, but=20 RedBlackTree does give you a set (or a sorted map with the appropriate=comparator function). =20 - Jonathan M Davis
Nov 29 2011
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.
Nov 29 2011