Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a MultiBag data structure #4

Closed
wants to merge 2 commits into from
Closed

Conversation

nvlbg
Copy link

@nvlbg nvlbg commented Jul 31, 2013

That's a data structure that I needed in a project I'm working on. I couldn't think of a way to use another structure from the existing ones, so I created this. I know that there aren't any tests or documentation strings. I'll write some if you think that this is a data structure that needs to be with the original buckets :)

@mauriciosantos
Copy link
Owner

Hi. Why cant you use a bag instead?

@nvlbg
Copy link
Author

nvlbg commented Jul 31, 2013

Actually this "MultiBag" is still not what I need. There will be some changes, but the basic idea is that I need a structure to store different elements, though the passed toString function might return the same key for them. Bag assumes that the element is the same. I thought maybe MultiDictionary might do it, but it had some missing functionality like forEach, so I thought I could create this "special" structure for my case. I'll return soon with more info.

@mauriciosantos
Copy link
Owner

In that case, you can simply write a foreach implementation for a multidictionary.

@nvlbg
Copy link
Author

nvlbg commented Aug 1, 2013

Well, another problem with MultiDictionary is that it uses arrays (for performance). In my case using dictionary of Sets with 2 toString functions solved the problem. I guess my case is really special and maybe this structure does not belong with the other ones. Check it out, and close the pull request if you think so :)

@mauriciosantos
Copy link
Owner

Sorry, but it is a really special case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants