digraph/vertex.c
/*
 * Creates and returns a Vertex* pointer. Takes a parameter void* pointer of a value
 * to be stored in the Vertex struct.
 */
Creates and returns a Vertex* pointer. Takes a parameter void* pointer of a value
to be stored in the Vertex struct.
Creates and returns a Vertex * pointer . Takes a parameter void * pointer of a value to be stored in the Vertex struct .
Vertex* create_vertex(void* element)
{
	Vertex* v = malloc(sizeof(*v));
	if(v == NULL)
		return NULL;
	v->data = malloc(sizeof(element));
	memcpy(v->data, element, sizeof(element));
	v->arcList  = linked_list_initialize(sizeof(Arc), "Arc");
	v->visited  = false;
	v->distance = 0;	
	v->parent   = NULL;
	return v;
}
Vertex * create_vertex ( void * element ) { Vertex * v = malloc ( sizeof ( * v ) ) ; if ( v == NULL ) return NULL ; v -> data = malloc ( sizeof ( element ) ) ; memcpy ( v -> data , element , sizeof ( element ) ) ; v -> arcList = linked_list_initialize ( sizeof ( Arc ) , " " ) ; v -> visited = false ; v -> distance = 0 ; v -> parent = NULL ; return v ; }
Creates and returns a Vertex* pointer.
Creates and returns a Vertex * pointer .