By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,129 Members | 1,245 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,129 IT Pros & Developers. It's quick & easy.

Implement a 'Bag' class ..Please Help

P: 1
Please help me with this problem:

Implement a "bag" class. A "bag" is like a set except that a bag may have duplicates. For this exercise, the bag's elements should be "int"s. The public interface should the following methods..
- Create a "Bag".
- Add a new element to a "Bag".
- Remove an element from a "Bag".
- Enumerate the elements in the "Bag".
- Compute the "intersection" of two "Bag"s "b1" and "b2"
- Compute the "union" of two "Bag"s "b1" and "b2"
- Compute the "difference" of two "Bag"s "b1" and "b2"
Implement this using constructors and deconstructors,
and the important thing is that,,bag may or may not contain duplicates..

Its very urgent..can u make this as soon as possible.
Mar 9 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,510
post the code you have written so far with an indication of the problems you have
Mar 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.