1. In the Towers of Hanoi puzzle there are __________________ disks of different
ID: 3855453 • Letter: 1
Question
1. In the Towers of Hanoi puzzle there are __________________ disks of different diameters.
a) 2
b) 3
c) 4
d)5
e) The Towers of Hanoi puzzle can include any number of disks of different diameters.
2. __________________ recursion results from the lack of a base case.
a) Indirect
b) Direct
c) Infinite
d) Spiral
e) none of the above
3. Suppose we would like to declare a generic type Group that only allows types that implement the Comparable interface. Which of the following declarations correctly declares such a class?
a) class Group<Comparable>
b) class Group<T(Comparable)>
c) class Group <T instanceof Comparable>
d) class Group<T extends Comparable <T>>
e) class Group<T>
4. A(n) ___________________ is an object that serves as a repository for other objects.
a) set
b) collection
c) class
d) interface
e) none of the above
5. A nonlinear collection is one in which the elements are stored in a straight line.
a) True
b) False
6. If you want to store non-duplicated objects in the order in which they are inserted, you should use ____________.
c) HashSet
d) LinkedHashSet
e) TreeSet
f) ArrayList
g) LinkedList
Explanation / Answer
1. e) The Towers of Hanoi puzzle can include any number of disks of different diameters.
2. c) Infinite
3. d) class Group<T extends Comparable <T>>
4.b) Collection
5.b) False
6.d) LinkedHashSet
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.