#include <stdio.h>#include <stdlib.h>#include <string.h>#define m 15#define n 50#define infinity 99999typedef struct node{ float distence; int vexnode; struct node next;}Arcnode;typedef struct vertexnode{ char name[30]; char information[100]; Arcnode head;} Line;typedef struct adjlist{ Line point[m]; int arcnum; int vexnum;} graph;typedef struct queue{ int father; int son; struct queue *next; }queue;typedef struct mst_point{ int father; int son; struct mst_point *next;}mst_point;//========================================================================//creat the graph and test itvoid init_matrix(float (*matrix) [m]){}void init_graph(graph g){ }void creat_graph(graph g,float (*matrix)[m],FILE *fp){ }void test(graph *g,float (*matrix)[m]){ Arcnode *temp; printf("the matrix is as follows:\n"); printf("%d\n",g->vexnum ); //sleep(5); for (int i = 0; i < g->vexnum; ++i) { for (int j = 0; j < g->vexnum; ++j) { printf("%6.1f ", matrix[i][j]); } printf("\n"); } printf("\n"); printf("%d\n", g->vexnum); for (int i = 0; i < g->vexnum; ++i) { temp=g->point[i].head->next; printf("point connected to '%s':",g->point[i].name); while(temp) { printf(" (%s,distence:%.1f) ", g->point[temp->vexnode].name,temp->distence); temp=temp->next; } printf("\n"); printf("information:%s", g->point[i].information); printf("\n\n\n"); } }//============================================================================//============================================================================//creat queue and all related functionqueue * init_queue(){}int empty(queue *head){}void push(queue head,int i,int j) // i:father point j:son point{}void pop(queue head,int i,int j){}void print_queue(queue head){}/void test_queue(queue head){ head=init_queue(); int order=-2; printf("test push:input the order:\n"); while(order != -1) { scanf("%d",&order); push(head,order); } printf("\n"); printf("test pop :\n"); while(!empty(head)) { pop(head,&order); printf("%d ",order); } printf("\n"); printf("test push:input the order:\n"); while(order !=-1) { scanf("%d",&order); push(head,order); } printf("\n"); printf("test pop :\n"); while(!empty(head)) { pop(head,&order); printf("%d ",order); } print_queue(head);}/ //==============================================================//find all way between two pointsvoid print_rout(graph g,queue head,int end){}int get_next(graph g,int father,int son){ }int contin_find(graphg,int father,int son,int start){ }void allways_bttps(graph *g,queue *head,int start,int end){ } /*void test_dfs(graph *g,queue *head,float (matrix)[m]){ int start=-1,end=-1; creat_graph(g,matrix); test(g,matrix); while((start!=0) || (end!=0)) { printf("input the start point and end_point:\n"); scanf("%d%d",&start,&end); allways_bttps(g,head,start,end); } }///=================================================================================//==================================================================================//find the shortest way between two points void dijkstra(graph *g,float (*matrix)[m],int start,int end,int dist[m],int path[m][m+1]){ }void test_dijs(int dist,int path[][m+1]){ }//===============================================================================//algorithm prim to get MST treemst_point * prim(graph g,float(matrix)[m],int start){ }void test_mst(mst_point head){ mst_point temp; temp=head->next; printf("the MST tree is:\n"); while(temp) { printf("(%d,%d) ", temp->father,temp->son); temp=temp->next; } printf("\n");}//=================================================================================void read(graph g,float (*matrix)[m],FILE *fp){ // fgets();//fget(); // atoi(); //printf("creat over!\n"); // test(g,matrix);}void display(graph *g){}void Select(graph g){}//==================================================================================void display_mst(graph g,mst_point *head){}void add(graph *g,float(*matrix)[m],int start,int end,float distence){ }void cut(graph *g,float(*matrix)[m],int start,int end){}void add_point(graph *g,float (*matrix)[m]){ // test(g,matrix);}/*void del_point(graph *g,float (matrix)[m]){ int choice; printf("\n places intrduction \n"); for (int i = 0; i < g->vexnum; ++i) { printf("%d : %s\n",i,g->point[i].name); } printf("input the point you want to del:"); scanf("%d",&choice); getchar(); }/int main(int argc, char const *argv[]){ graph g; queue *head; float matrix[m][m]; int path[m][m+1]; int start,end; int dist[m]; mst_point
点击代码块插入代码,注明填空的地方。