資源簡介
繪制基于本人的關系網(結點不少于 6),注:邊的權值代表關系緊密程度;分
析關系網的物理存儲類型;
2. 實現關系網的創建;
3. 按照深度遍歷和廣度遍歷算法輸出結點信息;
4. 實現從本人到某人的最可靠關系路徑
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include
#include
#define?MaxInt?65535
#define?MaxVex?100
#define?MVNum?100
#define?OK?1
#define?ERROR?0
typedef?char?VerTexType;
typedef?int?ArcType;
typedef?int?Status;
typedef?int?Bool;
using?namespace?std;
typedef?struct
{
???VerTexType?vexs[MVNum];
???ArcType?arcs[MVNum][MVNum];
???int?vexnumarcnum;
}AMGraph;
typedef?struct?{
????int????data[MaxVex];
????int????front?rear;
}Queue;
void?InitQueue(Queue?*Q)
{
????Q->front?=?Q->rear?=?0;
}
void?EnQueue(Queue?*Q?int?e)
{
????if?((Q->rear+1)%MaxVex?==?Q->front)
????????return?;
????Q->data[Q->rear]?=?e;
????Q->rear?=?(Q->rear+1)%MaxVex;
}
int?QueueEmpty(Queue?*Q)
- 上一篇:利用C語言寫的銀行排隊系統
- 下一篇:數據結構 線性表的運用CDUT學生
評論
共有 條評論