Computer Science 102 Quiz 4 Name____________________ 1. Suppose a list of type list_t contains three items. The number of calls made to free() by list_del() should be a. 1 b. 3 c. 6 d. 7 2. Suppose list_t *list is a pointer to a list that presently has no elements it it. The value of list->head should be: a. NULL b. the address of list->tail c. the address of a link_t d. the address of the last structure item that was removed from the list. 3. Suppose list_t *list points to a correct list header for a non-empty list and link_t *link points to a new link structure to be put on the end of the list. Which of the following approaches will correctly attach the link to the end of the list. a. list->tail = link; b. link->tail = link; list->tail->next = link; link->next = link; c. list->tail->next = link; d. Both a and c but not b. list->tail = link; 4. Suppose list_t *list points to a correct list header for an empty list and link_t *link points to a new link structure to be put on the list. Which of the following approaches will correctly attach the link to the start of the list. a. list->head = link; b. list->head = link; link->next = list->tail; list->tail = link; c. list->head->next = link; d. link->next = list->head; list->tail->next = link; list->tail = link; 5. Suppose the following structures are items on the list: typedef struct entity_type { char e_name[16]; int e_id; } e_t; Given the definition e_t *eloc; the correct way to print e_id value in the e_t structure pointed to by link_t *link is: a. e_t = (e_t *)link->item; b. e_t = (e_t *)link->next; printf("%d\n", e_t->e_id); printf("%d\n", e_t->e_id); c. eloc = (e_t *)link->item; d. eloc = (eloc *)link->item; printf("%d\n", eloc->e_id); printf("%d\n", eloc->e_id);