Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#139

Merged
merged 7 commits into from
Jun 19, 2017
Merged

#139

merged 7 commits into from
Jun 19, 2017

Conversation

yang5220
Copy link
Contributor

广度优先遍历及输出最短路径

Copy link
Contributor

@c4pr1c3 c4pr1c3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

随机抽查到,给了一点建议,是否修改自己拿主意,非强制要求修改。

break;
}
}
G->arcs[i][j].adj = 1;//���֮������ߣ���ֵΪ1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来这种风格的代码可能是源自你这儿啊? #144 你俩是好朋友?

}
}
//�����ڽӾ���;
LocateVex(G, 1, 2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考这里我的代码审查意见,一模一样的问题 #144

@yang5220
Copy link
Contributor Author

修改的作业中拆分了LocateVex的功能,仅输出顶点位置,添加InsertArc 函数连接两顶点

@c4pr1c3
Copy link
Contributor

c4pr1c3 commented May 27, 2017

我是专门来围观:二茶🌲的

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试运行的结果与提交的结果文件不同,结果有问题,注意作业要求是每次插入和删除节点都要进行遍历输出。需要进一步理清思路和逻辑,修改相应的代码。


//���������������
//����Ļ�������Ҫ�ı����ĵ�ַ�����Դ����Ƕ���ָ��
void inseart(PNode * T, KeyType key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意拼写..

{
if (flag == 1)
{
fwrite(d, sizeof(d), 1, pfile);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里sizeof计算的长度有问题,sizeof 是一个运算符,在代码的编译期被执行,具体可以参考C++语言爱好者众筹的这个维基页解释 http://zh.cppreference.com/w/c/language/sizeof

这里建议把变量d的声明和定义改写为数组形式,如下:

char d[] = ", ";

这样,再调用sizeof运算符的时候,在代码编译期即可正确计算出该变量所占用的内存空间大小为3

@yang5220
Copy link
Contributor Author

一次性提交的有点多,辛苦师姐了!!!

Copy link
Collaborator

@cucyoyo cucyoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 二叉排序树输出结果仍然有问题,如有时间继续修改,过期合并
  • 排序问题整体完成没有问题,建议使用函数提高代码重用性
  • Hash表建议生成更大的数据测试冲突情况
  • 正确使用git:直接在需要修改的文件上进行修改即可,git会自动记录文件变化情况,不需要创建多个文件,可以将个人文件夹里过期的文件进行删除和清理,以后修改代码在现有文件中直接修改即可

}
printf("\n�Ƚϴ���%d ��������: %d ����֮��: %d\n", count1, count2, count1 + count2);
printf("\n");
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以将每个排序结果输出的功能封装成一个函数,增强代码重用性。

{

temp.key = (int) rand() % size;
temp.val = (int) rand() % size;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里生成的数据永远都不会造成冲突,建议生成更大的数据以便测试冲突情况

@cucyoyo
Copy link
Collaborator

cucyoyo commented Jun 19, 2017

另外需要注意自动格式化

@c4pr1c3 c4pr1c3 merged commit 07cf57f into CUCCS:master Jun 19, 2017
@yang5220
Copy link
Contributor Author

好。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants