Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
 Dictonary(K key, V val)
 {
     this.key   = key;
     this.value = val;
     this.next  = null;
 }
Ejemplo n.º 5
0
 public Dictonary()
 {
     this.key   = default(K);
     this.value = default(V);
     this.next  = null;
 }