栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

无向图的关结点问题(数据结构课程设计)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

无向图的关结点问题(数据结构课程设计)

目录
  • 设计
    • 主要数据结构
      • 类依赖
      • 类 API
    • GUI
      • 外观设计
      • GUI 类
      • GUI 类 API
  • 分工
  • 风格约定

设计

主要数据结构(非 GUI), GUI 外观设计, GUI 类

主要数据结构

包括核心 邻接表&&tarjan 辅助 hash_map 线性表

类依赖

类 API

邻接表 by 赵元琪

class UDGraph{
public:
bool is_exist_vertex(std::string name);
int IsExistEdge(std::string &vertex_name_1, std::string &vertex_name_2);
int InsertVertex(std::string new_vertex_name);
void DeleteVertex(std::string delete_vertex_name);
void DeleteEdge(std::string vertex_name_1, std::string vertex_name_2, int num_delete);
Edge *InsertEdge(std::string vertex_name_1, std::string vertex_name_2);
VertexPosition Pos(std::string vertex_name);
// file
void CreateFromFile(std::string file_name);
void SaveAsFile(std::string file_name);
// reload
VertexPosition operator [] (std::string &vertex_name);
std::string operator [] (VertexPosition pos);
//
size_t num_vex();
size_t num_edge();
};

dfs 类(邻接表友元类) by 赵元琪

class DfsTarjan{
void SetGraph(UDGraph &graph);
int GetTraOrder();
void Make();
string CutVertex();
string CutEdge();
};

字符串哈希表(只支持 key 为 std::string 字符串) by 陈毅凯

class StringHashMap{
public:
unsigned int StringHashCode(const std::string &s);
void put(std::string key, const ValueType &value);
ValueType get(std::string key);
bool is_exist(std::string key);
bool erase(std::string key);
ValueType &operator [] (std::string key);
};

线性表 by 朱铭昆

class SqList{
public:
void push(T x);
void pop();
void erase(size_t pos);
int length();
void reserve(size_t size);
T& operator [](int i);
void operator= (const SqList &list)
};

tarjan 辅助类 by 朱铭昆

class DfsTarjanFuZhu{
void Set(int num);
void destroy();
VertexPosition First();
void Delete(VertexPosition position);
};
GUI 外观设计

外观设计主要使用 demo 设计软件 Axure rp

GUI 类依赖

GUI 类 API
class GEdge{
GVertex* vex1();
GVertex* vex2();
void ChangePos(GVertex* v, int x, int y);
void SetCut(bool is);
};
class GVertex{
void SetName(QString s);
void SetCut(bool is);
void AddEdge(GEdge *e);
void Destroy(QGraphicsScene *scene);
void RemoveEdge(GEdge *e);
void DeleteEdge(GVertex *v2, QGraphicsScene *scene);
GEdge *GetEdge(GVertex *v2);
void SetEdgeCut(bool is);
int VertexPos();
};
class StartWindow{
void ClickScanFile();
void ClickNewFile();
};
class MainWindow{
void ReadFile(QString file_name);
void SaveAsFile(QString file_name);
void ClickSave();
void ClickCreateVertex();
void ClickCreateEdge();
void ClickDeleteVertex();
void ClickDeleteEdge();
};
分工
赵元琪朱明昆陈毅凯
邻接表、dfs 类、GUI线性表、dfs 辅助类字符串哈希表
风格约定

代码的风格主要参考于 Google 开源项目风格指南

普通变量命名

小写,下划线相连

int table_name;
类内变量命名

结尾接下划线, 其他与普通变量一样

class ClassName{
private:
 int table_name_;
};
结构体变量命名

与普通变量一样,结尾不接下划线

struct StructName{
 int table_name;
};
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/931383.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号