digraph/vertex.c
/*
 * The has_arc_to_vertex funciton takes a source and destination vertex pointers, searches
 * the Arc list of the source vertex and returns true if the destination vertex is found in
 * the Arc list. Otherwise false is returned.
 */
The has_arc_to_vertex funciton takes a source and destination vertex pointers, searches
the Arc list of the source vertex and returns true if the destination vertex is found in
the Arc list. Otherwise false is returned.
The has_arc_to_vertex funciton takes a source and destination vertex pointers searches the Arc list of the source vertex and returns true if the destination vertex is found in the Arc list . Otherwise false is returned .
bool has_arc_to_vertex(Vertex* source, Vertex* destination)
{
	if(source == NULL || destination == NULL)
		return false;
	LinkedList* list = get_arc_list(source);
	for(int i = 0; i < linked_list_size(list); i++)
	{
		Arc* arc = (Arc*) linked_list_get(list, i);
		if(memcmp(arc->vertex, destination, sizeof(destination)) == 0)
		{
			return true;
		}
	}
	return false;
}
bool has_arc_to_vertex ( Vertex * source , Vertex * destination ) { if ( source == NULL || destination == NULL ) return false ; LinkedList * list = get_arc_list ( source ) ; for ( int i = 0 ; i < linked_list_size ( list ) ; i ++ ) { Arc * arc = ( Arc * ) linked_list_get ( list , i ) ; if ( memcmp ( arc -> vertex , destination , sizeof ( destination ) ) == 0 ) { return true ; } } return false ; }
The has_arc_to_vertex funciton takes a source and destination vertex pointers, searches
 the Arc list of the source vertex and returns true if the destination vertex is found in
 the Arc list.
The has_arc_to_vertex funciton takes a source and destination vertex pointers searches the Arc list of the source vertex and returns true if the destination vertex is found in the Arc list .
// If either the source or destination vertex are null, return false. // Retrieve the list of Arcs from the source vertex. // For each Arc in the Arc list. // Retrieve the Arc at index i in the list of Arcs. // If this Arc's vertex is equal to the destination vertex. // Immediately return true. // Otherwise, the destination vertex is not found in the Arc list, return false.