Hello there, more context would be beneficial from this question, but here is my best answer in pseudo code.
c)
int shortest_path(source,destination,paths)
{
if(source!=destination)
{
foreach path in paths
return shortest_path(path,destination,pathsOfPath)+1;//1 or the weight of the path
//pathsOfPath and paths could be in a list or 2d array
}
return 0;
}
}
d)
REFER TO Kruskal's Algorithm!
whenCreatingPath(visitedNodes,currentNode)
{
if(visitedNodes.contains(currentNode))
throw away
else
visitedNodes.add(currentNode)
}
}