91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 432KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-11
  • 語言: 其他
  • 標簽: 數據結構??課設??

資源簡介

數據結構課設——教學計劃編制問題。歡迎下載。

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?“header.h“
#include
#include
#include
#include




Status?ListInsert(linkList?&Lint?iElemType?e)
{?//插入弧結點?e弧信息?i插入位置
int?j=1;
linkList?sp=L;//p指向第一個結點?
if(i<1)
return?ERROR;
s=(linkList)malloc(sizeof(LNode));
s->data=e;
if(i==1)//插入表頭
{
s->nextarc=L;
L=s;
}
else
{?
while(p&&j {?
j++;
p=p->nextarc;
}
if(!p)
return?ERROR;
s->nextarc=p->nextarc;
p->nextarc=s;
}
return?OK;
}

int?LocateElem(linkList?LElemType?eStatus(*compare)(ElemTypeElemType))
{//返回相應弧結點的i位置
int?i=0;
linkList?p=L->nextarc;//p指向第一個結點
while(p)
{?
i++;
if(compare(p->datae))
return?i;
p=p->nextarc;
}
return?0;
}


Status?ListDelete(linkList?Lint?iElemType?&e)
{//把第i個弧結點賦給e然后刪除之?
int?j=0;
linkList?qp=L;
while(p->nextarc&&j {?
j++;
p=p->nextarc;
}
if(!p->nextarc||j>i-1)
return?ERROR;
q=p->nextarc;//q指向待刪除結點
p->nextarc=q->nextarc;
e=q->data;
free(q);
return?OK;
}


void?Input(VertexType?&ver)
{//輸入弧結點的值
scanf(“%s“&ver.name);
}
void?visit(VertexType?ver)
{?//打印弧結點的值
printf(“%s“ver.name);
}

void?InputScore(VertexType?&ver)
{//輸入學分?
scanf(“%d“&ver.score);
}
void?visitScore(VertexType?ver)
{//輸出學分
printf(“%d“ver.score);
}


void?InputArc(InfoType?*&arc)//輸入弧的相關信息
{?
arc=(InfoType?*)malloc(sizeof(InfoType));//動態生成存放弧的信息空間
scanf(“%d“&arc->weight);

}
void?OutputArc(InfoType?*arc)
{?//打印弧的相關信息
printf(“%s\n“arc);
}

int?LocateVex(ALGraph?GVertexType?u)
{?//返回頂點在圖中的位置
int?i;
for(i=0;i if(strcmp(u.nameG.vertices[i].data.name)==0)//頂點與給定的u頂點相同
return?i;
return?0;
}


VertexType?GetVex(ALGraph?Gint?v)
{//返回頂點V的值
if(v>=G.vexnum||v<0)
exit(OVERFLOW);
return?G.vertices[v].data;
}


void?InsertVex(ALGraph?&GVertexType?v)
{?//在圖中加入新的結點
G.vertices[G.vexnum].data=v;
G.vertices[G.vexnum].firstarc=NULL;
G.vexnum++;
}

Status?InsertArc(ALGraph?&GVertexType?vVertexType?w)
{??//在圖中加入弧
ElemType?e;//表結點的元素類型
int?ij;
//char?s1[3]=“邊“s2[3]=“-“;
char?s1[4]=“邊“s2[3]=“-“;
if(G.kind<2)//有向
{
strcpy(s1“弧“);
strcpy(s2“->“);
}
i=LocateVex(Gv);
j=LocateVex(Gw);
if(i<0||j<0)
return?ERROR;
G.arcnum++;//圖G的弧或邊的數目加1
e.adjvex=j;//弧頭表結點的值
e.info=NULL;
if(G.kind%2)
{?
printf(“請輸入%s%s%s%s的信息:“s1v.names2w.name);
InputArc(e.info);
}
ListInsert(G.vertices[i].firstarc1e);
if(G.kind>=2)//無向,生成另一個結點
{?
e.adjvex=i;//弧表尾結點的值
ListInsert(G.vertices[j].firstarc1e);
}
return?OK;
}


void?CreateGraph(ALGraph?&G)
{?//采用鄰接表構一個圖
int?ijkmn;
VertexType?v1v2;//頂點類型
ElemType?e;
char?s1[4]?=““;
char?s2[]?=?“000“;
printf(“*********************************************“);
printf(“\n請輸入所有的課程數量:“);
scanf(“%d“&G.vexnum);
//printf(“請輸入有幾個先后關系:“);
//scanf(“%d“&G.arcnum);
G.arcnum?=?0;

printf(“請輸入第%d個課程的信息:

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????326824??2011-12-20?20:56??3109006503莊文弘?設計11\設計\3109006503莊文弘?設計.docx

?????文件??????13379??2011-07-06?09:32??3109006503莊文弘?設計11\設計\graph.cpp

?????文件???????5160??2011-07-06?01:35??3109006503莊文弘?設計11\設計\header.h

?????文件???????1339??2011-07-04?22:26??3109006503莊文弘?設計11\設計\queue.cpp

?????文件????????155??2011-12-20?20:57??3109006503莊文弘?設計11\設計\readme.txt

?????文件???????2009??2011-07-05?17:46??3109006503莊文弘?設計11\設計\stack.cpp

?????文件????????301??2011-07-02?11:09??3109006503莊文弘?設計11\設計\stdafx.cpp

?????文件????????320??2011-07-02?11:09??3109006503莊文弘?設計11\設計\stdafx.h

?????文件???????6027??2011-07-06?09:38??3109006503莊文弘?設計11\設計\timeableSystem.cpp

?????文件?????477696??2011-07-06?09:35??3109006503莊文弘?設計11\設計\timeableSystem.exe

?????目錄??????????0??2011-12-20?20:57??3109006503莊文弘?設計11\設計

?????目錄??????????0??2011-12-20?20:51??3109006503莊文弘?設計11

-----------?---------??----------?-----??----

???????????????833210????????????????????12


評論

共有 條評論