Next Hash Hash Hash 13

How did we do this before?

             contains(assoc_list, key) {
               while (assoc_list && assoc_list.key != key)
                 assoc_list = assoc_list.next
               return assoc_list;
             }
             get(assoc_list, key) {
               node = contains(assoc_list, key)
               if (node) return node.value
               else      return Null
             }
             store(&assoc_list, key, value) {
               node = contains(assoc_list, key)
               if (node) node.value = value
               else {
                 newnode = new Node(key, value);
                 newnode.next = assoc_list
                 assoc_list = newnode
               }
             }

continued...
Next Copyright © 2015 M. J. Dominus