public void add(K key, V val) { Dictonary <K, V> next = this.next; while (next.next != null) { next = next.next; } next.next = new Dictonary <K, V>(key, val); }
public V find(K key) { Dictonary <K, V> next = this.next; while (next != null) { if (next.key.Equals(key)) { return(next.value); } next = next.next; } return(default(V)); }
public void remove(K key) { Dictonary <K, V> next = this.next; Dictonary <K, V> prev = this; while (next != null) { if (next.key.Equals(key)) { prev.next = next.next; return; } prev = next; next = next.next; } }
Dictonary(K key, V val) { this.key = key; this.value = val; this.next = null; }
public Dictonary() { this.key = default(K); this.value = default(V); this.next = null; }