摘要: 还搞算法,差点儿被算法搞死……山西加油!闹他闹他!哈哈哈哈哈哈……苦逼又要贴代码了生成了一张图 1 #include <iostream> 2 #include <vector> 3 #include "windows.h" 4 5 6 using namespace std; 7 using std::vector; 8 9 10 struct ArcBox 11 { 12 int headvex,tailvex; 13 ArcBox *hlink,*tlink; 14 float weight; 15 }; 16 ... 阅读全文
posted @ 2012-02-24 22:44 uniquews 阅读(428) 评论(1) 推荐(0) 编辑
摘要: 下午效率不是很高。在收尾的时候把两棵树的显示分开了,更有“森林”的感觉。但是美中不足的每棵树的最后一个节点还是有“->",虽然我已经模仿Yan版教材加上了begin&end,稍微看着不那么突兀。本想写个判断把最后那个箭头删了,目前还是没有成功…… 1 #include <iostream> 2 using namespace std; 3 4 template <class TElemType> 5 struct Treenode 6 { 7 TElemType data; 8 Treenode<TElemType> *lchild, 阅读全文
posted @ 2012-02-23 18:59 uniquews 阅读(1060) 评论(0) 推荐(0) 编辑
摘要: 之前只有十字链表的创建,这篇包含创建和输出两个函数,用c++模板类实现。 1 #include <iostream> 2 3 using namespace std; 4 5 template <class TElemType> 6 class Graph 7 { 8 public: 9 void CreateOlgraph(); 10 void PrintOlgraph(); 11 private: 12 struct ArcBox 13 { 14 int headvex,tailvex; 15 ArcBox *hlink... 阅读全文
posted @ 2012-02-23 12:53 uniquews 阅读(2439) 评论(0) 推荐(0) 编辑
摘要: 基础不扎实 >_<!C++中传值参数和引用参数怎样区别呢?看以下例子:#include<iostream>using namespace std;void swap(int a,int b){int temp;temp=a;a=b;b=temp;}main(){int a=3,b=5;cout<< "before ‘swap’:a="<<a<<",b="<<b<<endl;swap(a,b);cout<<"after‘swap’:a="&l 阅读全文
posted @ 2012-02-23 10:39 uniquews 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 多行注释:Ctrl+k-->ctrl+c取消多行注释:Ctrl+K-->Ctrl+U复制整行:当光标在某一行随便哪个位置时(注意不要选中字符)+Ctrl+C删除整行:和上面的一样,按下Ctrl+Delete,将会删除光标所在的行。查找:选中某个单词,按下Ctrl+F3查找下一个:F3打开查找窗口:Ctrl+F打开查找替换窗口:Ctrl+H查看代码:F7查看编辑环境:Shift+F7查看属性:F4关闭当前页面:Ctrl+F4不调试运行:Ctrl+F5调试运行:F5转到定义:F12设置(取消)断点:F9取消所有断点:Ctrl+Shift+F9快速监视:Shift+F9格式换代码显示:C 阅读全文
posted @ 2012-02-22 23:27 uniquews 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 3 using namespace std; 4 5 template <class TElemType> 6 class Graph 7 { 8 public: 9 10 void CreateOlgraph(); 11 void DFSOlgraph(int v,bool *visited,int *finished); //表示顺向深度优先搜索 12 void DFSOlgraph(int v,bool *visited); 13 void Conponderance();... 阅读全文
posted @ 2012-02-22 16:11 uniquews 阅读(533) 评论(0) 推荐(0) 编辑
摘要: 1 //DFSTraverse.cpp 2 //This function is to traver ALGraph by DFS Algorithm 3 # include <iostream> 4 # include <malloc.h> 5 # include <conio.h> 6 7 # define MAX_VERTEX_NUM 20 8 # define OK 1 9 10 using namespace std; 11 12 typedef int VertexType; 13 typedef int InfoType; 14 15 type 阅读全文
posted @ 2012-02-22 14:52 uniquews 阅读(1372) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/kay_sprint/article/details/6661531 阅读全文
posted @ 2012-02-22 09:20 uniquews 阅读(283) 评论(0) 推荐(0) 编辑
摘要: View Code 1 //CreateDG.cpp 2 //This function is to create OLGraph 3 # include <iostream.h> 4 # include <malloc.h> 5 # include <conio.h> 6 7 # define MAX_VERTEX_NUM 20 8 # define OK 1 9 typedef int VertexType;10 typedef int InfoType;11 12 typedef struct ArcBox //结构名 //define structu 阅读全文
posted @ 2012-02-21 23:58 uniquews 阅读(243) 评论(0) 推荐(0) 编辑
摘要: http://www.iteye.com/topic/143629 阅读全文
posted @ 2012-02-21 21:21 uniquews 阅读(117) 评论(0) 推荐(0) 编辑