


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



struct association { KeyType key; ValueType value; };
void dyArrayDictionaryPut (struct dyArray *data, KeyType key, ValueType val) { struct association * ap; if (dyArrayDictionaryContainsKey(vec, key)) dyArrayDictionaryRemoveKey (vec, key); ap = (struct association *) malloc(sizeof(struct association)); assert(ap != 0); ap->key = key; ap->value = val; dyArrayAdd(vec, ap); }
void dyArrayDictionaryGet (struct dyArray *dy, KeyType key, ValueType *valptr);
containsKey (Object key) O( get (Object key) O( put (Object key, Object value) O( remove (Object key) O(
/* dynamic array dictionary interface file */
struct association { KeyType key; ValueType value; };
void dyArrayDictionaryGet (struct vector *vec, KeyType key, ValueType *valptr) { } void dyArrayDictionaryPut (struct vector *vec, KeyType key, ValueType val) { struct association * ap; if (vectorMapContainsKey(vec, key)) vectorMapRemove(vec, key); ap = (struct association *) malloc(sizeof(struct association)); assert(ap != 0); ap->key = key; ap->value = val; vectorAdd(vec, ap); } int dyArrayDictionaryContainsKey (struct vector *vec, KeyType key) { } void dyArrayDictionaryRemove (struct vector *vec, KeyType key) { }