deleting source node from adjacency list and all related nodes to the source

hi there I have this struct info


struct Graph
{
  // An array of pointers to Node to represent an adjacency list
  size_t nodes;
  struct Node *head[];
};

// Data structure to store adjacency list nodes of the graph
struct Node
{
  int dest, weight;
  struct Node *next;
};

how can I remove the head with all related nodes for him
for example, I want to delete the head[1]
see the image for better understanding>>
image

after deleting>>
image

can any body help me create the delete ,search and insert functions?

Comments (0)