Question

Answer the following questions for the method intersection () below: public Set intersection (Set s1, Set s2) //Effects: If s

1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

SOLUTION:

(a) Yes, the partition validity of Set s1 satisfies the completeness property as Set s1 can either be null or empty or has at least 1 element in it. Any value given to the Set s1 will fit in one of the three conditions and there cannot be any value for s1 which doesn't satisfy any of the 3 conditions.

(b) Yes, the partition validity of Set s1 satisfies the disjointness property i.e. no value of Set s1 can qualify for more than 1 condition. The values will either give a null set, an empty set or a set with at least 1 element in it. The value cannot fit in more than 1 partition.

(c) Yes, it displays the completeness, if s1,s2 are not null sets then there can't be any condition outside the given four.

(d) No it doesn't display the disjointness property as when s1= {} and s2={} i.e. both sets are empty will one consider the condition s1 & s2 represent the same set or the condition that s1 & s2 do not have any elements in common.

Add a comment
Know the answer?
Add Answer to:
Answer the following questions for the method intersection () below: public Set intersection (Set s1, Set s2) //Effects: If s1 or s2 is null throw NullPointerException /I else return a (non nul) Set...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT