CISC 320 Algorithms Assignment 8 Problem 1. (Exercise 29.5) Write a procedure to delete an edge from an undirected graph represented by adjacency lists. Edge (i,j) is represented by j being on i's adjacency list and i being on j's adjacency list. void delete_edge(node* adj[], // adjacency list for each vertex int V, // number of vertices int i, int j) // verticse on edge to be deleted { ... } Problem 2. Exercise 29.8 Explain your answer. Definition: A spider is a graph which looks like this: L1 / / E--H--B... \ \ Ln-3 That is, it has some node (call it the eyes) which connected only to a second node (call it the head) which is connected only to the eyes and one other node (the body). The body node is then connected to all other nodes (the legs). Thus the body node is connected to all but one node. The leg nodes are all connected to the body node, are not connected to the head or eye nodes, but may be arbitrarily connected among themselves. In other words, a leg node may be connected to as few as one node (the body) or to as many as n-3 nodes (all other legs plus the body). Problem 3. Write a algorithm to determine if a given graph is a spider or not, for an undirected graph represented by adjacency lists. Your algorithm should run in O(V) time where V is the number of vertices. Problem 4. Write a algorithm to determine if a given graph is a spider or not, for an undirected graph represented by an adjacency matrix. Your algorithm should run in O(V) time where V is the number of vertices. This requires a clever idea.