digraph/directed_graph.c
/*
 * A compare function used to compare vertex structs. This function
 * accepts two vertex* structs as void*, casts them to Vertex*,
 * and compares them based on their distance data member.
 */
A compare function used to compare vertex structs. This function
accepts two vertex* structs as void*, casts them to Vertex*,
and compares them based on their distance data member.
A compare function used to compare vertex structs . This function accepts two vertex * structs as void * casts them to Vertex * and compares them based on their distance data member .
int compareVertex(void* a, void* b)
{
	if(a == NULL || b == NULL)
		return -1;
	Vertex* v1 = (Vertex*) a;
	Vertex* v2 = (Vertex*) b;
	return (int) v1->distance - v2->distance;
}
int compareVertex ( void * a , void * b ) { if ( a == NULL || b == NULL ) return -1 ; Vertex * v1 = ( Vertex * ) a ; Vertex * v2 = ( Vertex * ) b ; return ( int ) v1 -> distance - v2 -> distance ; }
A compare function used to compare vertex structs.
A compare function used to compare vertex structs .
// Casting void* paremeters to Vertex pointers.