Question: Java - data structure The file UnsortedLinkedDictionary.java contains unimplemented methods for a dictionary based on an unsorted linked list. Implement all these methods. import java.util.Iterator;

Java - data structure

The file UnsortedLinkedDictionary.java contains unimplemented methods for a dictionary based on an unsorted linked list. Implement all these methods.

import java.util.Iterator; import java.util.NoSuchElementException;

public class UnsortedLinkedDictionary { public UnsortedLinkedDictionary() {

} // end default constructor public V add(K key, V value) { } // end add

public V remove(K key) { } // end remove

public V getValue(K key) { } // end getValue

public boolean contains(K key) { } // end contains

public boolean isEmpty() { } // end isEmpty public int getSize() { } // end getSize

public final void clear() { } // end clear

public Iterator getKeyIterator() { } // end getKeyIterator public Iterator getValueIterator() { } // end getValueIterator

private class Node { private K key; private V value; private Node next;

private Node(K searchKey, V dataValue) { key = searchKey; value = dataValue; next = null; } // end constructor private Node(K searchKey, V dataValue, Node nextNode) { key = searchKey; value = dataValue; next = nextNode; } // end constructor private K getKey() { return key; } // end getKey private V getValue() { return value; } // end getValue

private void setValue(V newValue) { value = newValue; } // end setValue

private Node getNextNode() { return next; } // end getNextNode private void setNextNode(Node nextNode) { next = nextNode; } // end setNextNode } // end Node } // end UnsortedLinkedDictionary

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!