There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
I agree that it is B. It think it is B because there are three unique strings going into the set, and the collection size only looks for unique strings. This still leaves me wondering how a set is different than an array or other form of data manipulation.
A set is just a list of non-repeating items. So adding an item that is already there will not actually add anything to the set.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
The application I have thought of for sets are for registrations (keeping track of who requested access to a resource). The set avoids duplicate registrations.
I'm sure there are others, I just haven't found them yet.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
For those asking for applications for a set, I recently used one (first legitimate use) for an exclusion list (ie don't do something if the message matches something in the set). I chose the set over a simple array for the duplication issue and a faster search.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions Unofficial Forum Rules and Guidelines "Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
B. The Set is a hash table structure which only include unrepeated elements. Using Set could save searching time significantly because searching element of Set is O(1) in a N size set but array is O(N) for a N size array.