1. (int) (Math.random( ) * 21) – 10
2. All the methods are constant time except for remove, grab, countOccurrences, and clone (all of which are linear); the addAll method (which isO(n), wherenis the size of the addend); and the union method (which is O(m+n), wheremandnare the sizes of the two bags).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here