没有合适的资源?快使用搜索试试~ 我知道了~
校园导航系统--数据结构
4星 · 超过85%的资源 需积分: 15 6 下载量 58 浏览量
2011-06-02
13:49:40
上传
评论
收藏 10KB TXT 举报
温馨提示
试读
10页
校园导航系统,使用拓扑排序对校园进行路径分析,寻找最短路径和查询信息。
资源推荐
资源详情
资源评论
// 校园导航.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#define INFINITY 10000 /*无穷大*/
#define MAX_VERTEX_NUM 40
#define MAX 40
#include<stdlib.h>
#include<string.h>
#include <iostream>
using namespace std;
#include <iomanip>
typedef struct ArCell
{
int adj; //路径长度
}ArCell,AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct //图中顶点表示主要景点,存放景点的编号、名称、简介等信息,
{
char name[30];
int num;
char introduction[100];//简介
}infotype;
typedef struct
{
infotype vexs[MAX_VERTEX_NUM];
AdjMatrix arcs;
int vexnum,arcnum;
}
MGraph;
MGraph b;
//
#include "stdafx.h"
#define INFINITY 10000 /*无穷大*/
#define MAX_VERTEX_NUM 40
#define MAX 40
#include<stdlib.h>
#include<string.h>
#include <iostream>
using namespace std;
#include <iomanip>
typedef struct ArCell
{
int adj; //路径长度
}ArCell,AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct //图中顶点表示主要景点,存放景点的编号、名称、简介等信息,
{
char name[30];
int num;
char introduction[100];//简介
}infotype;
typedef struct
{
infotype vexs[MAX_VERTEX_NUM];
AdjMatrix arcs;
int vexnum,arcnum;
}
MGraph;
MGraph b;
MGraph InitGraph(void);
void Menu(void);
void Browser(MGraph *G);
void ShortestPath_DIJ(MGraph * G);
void Floyd(MGraph *G);
void Search(MGraph *G);
/***********************主函数*******************************/
void main(void)
{
system("mode con: cols=100 lines=40");
int i;
b=InitGraph();
Menu();
cin>>i;
while(i!=5)
{
switch(i)
{
case 1:system("cls");Browser(&b);Menu();break;
case 2:system("cls");ShortestPath_DIJ(&b);Menu();break;
case 3:system("cls");Floyd(&b);Menu();break;
case 4:system("cls");Search(&b);Menu();break;
case 5:exit(1);break;
default:break;
}
cin>>i;
}
}
剩余9页未读,继续阅读
资源评论
- 王仙客丶2012-11-19比较简单的代码,可以参考下.
bingmengxiao
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功