PLEASE IDENTIFY ALL PARTS OF THE CODE/ COMPLETE THE TABLE: A B C D E F G H I J K
ID: 3842746 • Letter: P
Question
PLEASE IDENTIFY ALL PARTS OF THE CODE/ COMPLETE THE TABLE:
A B C D E F G H I J K L M N class LinkedHashEntry private int key: int value Linked HashEntry next: public Linked HashEntry (int key int value n this key key this value value this next int getKey return key: int getValue return value: void setValue int value this value value LinkedHashEntry getNext return next void setNext (LinkedHashEntry next) this next const int TABLE SIZE 128 class HashMap private Linked HashEntry table public HashMap table new LinkedHashEntr tTABLE-SIZEl: for int i 0: i TABLE SI2E: it table Di NULL: int get (int key) int hash key t TABLE SIZE if (table hash NULL) return -1 else LinkedHashEn entry tab while entry NULL & 6 entry->getKey entry entry->getNext if (entry NULL) return -1; else return entry->getValueExplanation / Answer
Data members of class. Integer type arguments- key and value passed to the parameterized constructor to initialize data members. Mutator and Accessor functions to get and access values of the data members Initializing constant integer variable and TABLE_SIZE to 128 Default constructor Modulus operation on key and TABLE_SIZE If- else statements Accessor function ‘put’ with Integer type arguments- key and value. If condition to check weather table(hash) is NULL Beginning of else statement Member function remove with integer variable key as argument Checking weather table(hash) is not NULL Checking if entry -> getKey() is equal to key Destructor function to constructor Hashmap()
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.