Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1)The Oracle API class HashMap extends the class AbstractMap and implements the

ID: 3679100 • Letter: 1

Question

1)The Oracle API class HashMap extends the class AbstractMap and implements the interface Map. True or False

2)PriorityQueue<E> stores elements in an array sorted in ascending order according to the Comparator for E.

True

False

3)The heap data structure is normally stored as an array.

True

False

4)A hash function normally returns an array which acts like a table.

True

False

5)In hashing, the data are organized into an array with the help of a table, called the hash table.


True

False

6)The Oracle API class HashMap extends the class AbstractMap and implements the interface Map.


True

False

Explanation / Answer

1).public abstract class AbstractMap<K,V> extends Object implements Map<K,V>.

Thisclass provides a skeletal implementation of the Map interface, ...

Returns true if thismap contains a mapping for the specified key.

boolean ... If the iteration terminates without finding such an entry, false is returned.

So,in the question they didn't mention whether this map returns or not so,put TRUE.

2)TRUE

An unbounded priority queue based on a priority heap.

The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor is used.

3)TRUE

Heaps are usually implemented in an array (fixed size or dynamic array), and do not require pointers between elements.

After an element is inserted into or deleted from a heap, the heap property may be violated and the heap must be balanced by internal operations.

4)TRUE

The mapping between an item and the slot where that item belongs in the hash table is called the hash function.

The hash function will take any item in the collection and return an integer in the range of slot names, between 0 and m-1.

5)TRUE

A hash table, or a hash map, is a data structure that associates keys with values.

The primary operation it supports efficiently is a lookup: given a key (e.g. a person's name), find the corresponding value (e.g. that person's telephone number).

It works by transforming the key using a hash function into a hash, a number that the hash table uses to locate the desired value.

This hash maps directly to a bucket in the array of key/value pairs, hence the name hash map. The mapping method lets us directly access the storage location for any key/value pair.

6)TRUE