- 博客(3)
- 资源 (1)
- 收藏
- 关注
原创 c++代码实现图的DFS遍历
深度优先搜索,从名字上理解,只要存在点和连接的边,就在图中尽可能的深入,一直到从该节点出发的所有的点都被发现为止。一旦节点v的所有处罚边都被发现,然后就回到v的前驱结点,重复操作 #include #include using namespace std; int Matric[50][50]; int Visited[50]; int vertex,edge; void DFS
2016-03-18 10:44:20 1709
原创 c++代码实现图的BFS遍历
图的广度优先搜索(BFS)是最 #include #include #include using namespace std; int Matric[50][50]; int Visited[50]; int vertex,edge; //设定为全局变量,二维数组用于表示图,Visited数组设定 //为访问数组,用来保存图中节点的访问状态,vertex表示定点数
2016-03-18 10:17:09 1636
原创 函数atof的功能及使用
/*函数名atof 定义函数 double atof(const char*nptr) 函数功能 将字符串转化为浮点数,函数会从左往右依次扫描,从第一个数字 或正负号开始,到第一个不为数字或‘.’为止; */ #include #include int main(){ char str[] = " 78649.2161+45"; double f; f =
2016-03-13 11:57:49 1052
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人