Question: ou will now extend the functionality of the map library we are constructing. Add the functions to the appropriate C file as the naming above
ou will now extend the functionality of the map library we are constructing. Add the functions to
the appropriate C file as the naming above would indicate.
i points Write a function called map add ordered key that takes arguments:
a pointer to struct map list,
a key to add, and
the value corresponding to the added key.
a function pointer with the signature int cmp keychar item key, char add key
As with the normal add function, this function should find a node on the freelist and add it
to the list. However, this function should repeatedly call the cmp key function provided with
the key to add and the current list items key. The cmp key function should match the API of
strncmp returning and respectively The map add ordered key function should find
locate the first equal item or the end of the list and insert the new node. As with regular
add, this function should return if the item is added successfully, and if not
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
