Question: / * * * Your implementation of a ExternalChainingHashMap. * / public class ExternalChainingHashMap { / * * The initial capacity of the ExternalChainingHashMap when

/**
* Your implementation of a ExternalChainingHashMap.
*/
public class ExternalChainingHashMap {
/*
* The initial capacity of the ExternalChainingHashMap when created with the
* default constructor.
*
* DO NOT MODIFY THIS VARIABLE!
*/
public static final int INITIAL_CAPACITY =13;
/*
* The max load factor of the ExternalChainingHashMap.
*
* DO NOT MODIFY THIS VARIABLE!
*/
public static final double MAX_LOAD_FACTOR =0.67;
/*
* Do not add new instance variables or modify existing ones.
*/
private ExternalChainingMapEntry[] table;
private int size;
/**
* Constructs a new ExternalChainingHashMap with an initial capacity of INITIAL_CAPACITY.
*/
public ExternalChainingHashMap(){
//DO NOT MODIFY THIS METHOD!
table =(ExternalChainingMapEntry[]) new ExternalChainingMapEntry[INITIAL_CAPACITY];
}
/**
* Returns whether or not the key is in the map.
*
* @param key The key to search for in the map. You may assume that the
* key is never null.
* @return true if the key is contained within the map, false otherwise.
*/
public boolean containsKey(K key){
// WRITE YOUR CODE HERE (DO NOT MODIFY METHOD HEADER)!
}
/**
* Returns the table of the map.
*
* For grading purposes only. You shouldn't need to use this method since
* you have direct access to the variable.
*
* @return The table of the map.
*/
public ExternalChainingMapEntry[] getTable(){
// DO NOT MODIFY THIS METHOD!
return table;
}
/**
* Returns the size of the map.
*
* For grading purposes only. You shouldn't need to use this method since
* you have direct access to the variable.
*
* @return The size of the map.
*/
public int size(){
// DO NOT MODIFY THIS METHOD!
return size;
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!