1)The JAVA API makes use of binary tree heaps in which Class? TreeMap TreeSet Pr
ID: 3679103 • Letter: 1
Question
1)The JAVA API makes use of binary tree heaps in which Class?
TreeMap
TreeSet
PriorityQueue
AbstractQueue
----------------------------------------------------------
2)HashSet uses a hash table for data storage, so basic operations such as add, remove, and contains will have big-O performance:
O(1)
O(N)
O(N*logN)
O(N^2)
--------------------------------------------
3)Hash codes are provided for ALL Classes in Java from
Object
Hashtable
HashSet
HashMap
Flag this Question
-----------------------------------------------
4)All Classes in JAVA inherit a method hashCode() that returns:
boolean
int
double
None of above, the programmer must create a hashCode() method.
---------------------------------------------------------------------------------------------------------
5)The Oracle API class HashSet extends the class ____ and implements the interface Set.
AbstractMap
AbstractSequentialList
AbstractList
AbstractSet
Explanation / Answer
1) priority queue
priority queue will makes use of binary heap for its implementation
2)O(1)
for the space storage it uses the O(n)
3)object
every object will have the hashcode
4) int
hash code returns int value
punlic int hashcode()
5) abstractset
public class HashSet<E> extends AbstractSet<E>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.