大体与上次实验相同,特点为图是邻接表存储结构

--博客后半部分有程序的所有代码--

1、图邻接表存储结构表示及基本操作算法实现

所加载的库函数或常量定义及类的定义:

  1. #include "SeqQueue.h"
  2. const int MaxVertices = ;
  3. const int MaxWeight=;

(1)邻接表存储结构类定义:

  1. struct EdgeType
  2. {
  3. int dest;
  4. DistT weight;
  5. EdgeType *next;
  6.  
  7. EdgeType(){};
  8. EdgeType(int d, DistT w): dest(d), weight(w), next(NULL){}
  9. };
  10. struct ItemType
  11. {
  12. VerT data;
  13. EdgeType *adj;
  14. };
  15.  
  16. class AdjTWGraph
  17. {
  18. private:
  19. ItemType Vertices[MaxVertices];
  20. int numVertices;
  21. double numOfEdges;
  22.  
  23. void DepthFirstSearch(const int v, int visited[]);
  24. void BroadFirstSearch(const int v, int visited[]);
  25. public:
  26. AdjTWGraph(void);
  27. ~AdjTWGraph(void);
  28.  
  29. int NumOfVertices(void)
  30. {return numVertices;}
  31. double NumOfEdges(void)
  32. {return numOfEdges;}
  33. VerT GetValue(const int i);
  34. int GetWeight(const int v1, const int v2);
  35. void Show(); //输出邻接矩阵结果
  36. void InsertVertex(const VerT &vertex);
  37. void InsertWayEdge(const int v1, const int v2, int weight);
  38. void InsertNoWayEdge(const int v1, const int v2, int weight);
  39. void DeleteVertex(const int v);
  40. void DeleteEdge(const int v1, const int v2);
  41.  
  42. int GetFirstNeighbor(const int v);
  43. int GetNextNeighbor(const int v1, const int v2);
  44.  
  45. void DepthFirstSearch();
  46. void BroadFirstSearch();
  47. };

(2)创建邻接表算法

创建无向网邻接表算法:

  1. void CreatNoWayWeb(AdjTWGraph &G, DataType V[],int n,RowColWeight E[], int e)
  2. {
  3. //在图G中插入n个顶点
  4. for(int i = ; i < n; i++)
  5. G.InsertVertex(V[i]);
  6. //在图G中插入e条边
  7. for(int k = ; k < e; k++)
  8. {
  9. if(E[k].row>E[k].col)
  10. {
  11. cout<<"无向网参数输入错误";
  12. exit();
  13. }
  14. G.InsertNoWayEdge(E[k].row, E[k].col, E[k].weight);
  15. G.InsertNoWayEdge(E[k].col, E[k].row, E[k].weight);
  16. }
  17. }

创建有向网邻接表算法:

  1. void CreatWayWeb(AdjTWGraph &G, DataType V[], int n,RowColWeight E[],int e)
  2. //在图G中插入n个顶点V和e条边E
  3. {
  4. //在图G中插入n个顶点
  5. for(int i = ; i < n; i++)
  6. G.InsertVertex(V[i]);
  7.  
  8. //在图G中插入e条边
  9. for(int k = ; k < e; k++)
  10. G.InsertWayEdge(E[k].row, E[k].col, E[k].weight);
  11. }

(3)输出邻接表结果算法

  1. void AdjTWGraph::Show()
  2. {
  3. for(int i=;i<numVertices;i++)
  4. {
  5. for(int j=;j<numVertices;j++)
  6. {
  7. int a=GetWeight(i,j);
  8. if(a==MaxWeight)
  9. cout<<"∞ ";
  10. else
  11. cout<<a<<" ";
  12. }
  13. cout<<endl;
  14. }
  15. }

测试结果粘贴如下:

2、图的遍历递归算法

(1)(存储结构为邻接表)深度优先遍历算法-递归算法

  1. void AdjTWGraph::DepthFirstSearch()
  2. {
  3. int *visited = new int[NumOfVertices()];
  4. for(int i = ; i < NumOfVertices(); i++) visited[i] = ;
  5. for(int i = ; i < NumOfVertices(); i++)
  6. if(! visited[i])
  7. DepthFirstSearch(i, visited);
  8. delete []visited;
  9. }
  10.  
  11. void AdjTWGraph::DepthFirstSearch(const int v, int visited[])
  12. {
  13. cout<<GetValue(v)<<" ";
  14. visited[v] = ;
  15.  
  16. int w = GetFirstNeighbor(v);
  17. while(w != -)
  18. {
  19. if(! visited[w])
  20. DepthFirstSearch(w, visited);
  21. w = GetNextNeighbor(v, w);
  22. }
  23. }

测试结果粘贴如下:

  1. int main()
  2. {
  3. AdjTWGraph g,f;
  4. char a[] = {'A','B','C','D','E'};
  5. char b[] = {'A','B','C','D','E','F'};
  6.  
  7. RowColWeight r1[] ={{,,},{,,},{,,},{,,},{,,},{,,}};
  8. RowColWeight r2[] ={{,,},{,,},{,,},{,,},{,,},{,,},{,,}};
  9. int n1,n2,e1,e2;
  10. n1=sizeof(a)/sizeof(a[]);
  11. n2=sizeof(b)/sizeof(b[]);
  12. e1=sizeof(r1)/sizeof(r1[]);
  13. e2=sizeof(r2)/sizeof(r2[]);
  14. CreatWayWeb(g, a, n1, r1, e1); //创建有向网
  15. CreatNoWayWeb(f, b, n2, r2, e2); //创建无向网
  16.  
  17. cout<<"有向网:"<<endl;
  18. cout << "\n深度优先搜索序列为:";
  19. g.DepthFirstSearch();
  20. cout<<"\n\n无向网"<<endl;
  21. cout << "\n深度优先搜索序列为:";
  22. f.DepthFirstSearch();
  23. return ;
  24. }

有向网/无向网的测试结果:

(2)广度优先遍历算法(递归算法)

  1. void AdjTWGraph::BroadFirstSearch()
  2. {
  3. int *visited = new int[NumOfVertices()];
  4. for(int i = ; i < NumOfVertices(); i++) visited[i] = ;
  5. for(int i = ; i < NumOfVertices(); i++)
  6. if(!visited[i]) BroadFirstSearch(i, visited);
  7. delete []visited;
  8. }
  9.  
  10. void AdjTWGraph::BroadFirstSearch(const int v, int visited[])
  11. {
  12. VerT u, w;
  13. SeqQueue queue;
  14. cout<<GetValue(v)<<" ";
  15. visited[v] = ;
  16. queue.Append(v);
  17. while(queue.NotEmpty())
  18. {
  19. u = queue.Delete();
  20. w = GetFirstNeighbor(u);
  21. while(w != -)
  22. {
  23. if(!visited[w])
  24. {
  25. cout<<GetValue(w)<<" ";;
  26. visited[w] = ;
  27. queue.Append(w);
  28. }
  29. w = GetNextNeighbor(u, w);
  30. }
  31. }
  32. }

测试结果粘贴如下:

  1. int main()
  2. {
  3. AdjTWGraph g,f;
  4. char a[] = {'A','B','C','D','E'};
  5. char b[] = {'A','B','C','D','E','F'};
  6.  
  7. RowColWeight r1[] ={{,,},{,,},{,,},{,,},{,,},{,,}};
  8. RowColWeight r2[] ={{,,},{,,},{,,},{,,},{,,},{,,},{,,}};
  9. int n1,n2,e1,e2;
  10. n1=sizeof(a)/sizeof(a[]);
  11. n2=sizeof(b)/sizeof(b[]);
  12. e1=sizeof(r1)/sizeof(r1[]);
  13. e2=sizeof(r2)/sizeof(r2[]);
  14. CreatWayWeb(g, a, n1, r1, e1); //创建有向网
  15. CreatNoWayWeb(f, b, n2, r2, e2); //创建无向网
  16.  
  17. cout<<"有向网:"<<endl;
  18. cout << "\n广度优先搜索序列为:";
  19. g.BroadFirstSearch();
  20. cout<<"\n\n无向网"<<endl;
  21. cout << "\n广度优先搜索序列为:";
  22. f.BroadFirstSearch();
  23. return ;
  24. }

有向网/无向网的测试结果:

最后附上整体代码结构与结果

AdjTWGraph.h

  1. #include "SeqQueue.h"
  2. const int MaxVertices = ;
  3. const int MaxWeight=;
  4. struct EdgeType
  5. {
  6. int dest;
  7. DistT weight;
  8. EdgeType *next;
  9.  
  10. EdgeType(){};
  11. EdgeType(int d, DistT w): dest(d), weight(w), next(NULL){}
  12. };
  13. struct ItemType
  14. {
  15. VerT data;
  16. EdgeType *adj;
  17. };
  18.  
  19. class AdjTWGraph
  20. {
  21. private:
  22. ItemType Vertices[MaxVertices];
  23. int numVertices;
  24. double numOfEdges;
  25.  
  26. void DepthFirstSearch(const int v, int visited[]);
  27. void BroadFirstSearch(const int v, int visited[]);
  28. public:
  29. AdjTWGraph(void);
  30. ~AdjTWGraph(void);
  31.  
  32. int NumOfVertices(void)
  33. {return numVertices;}
  34. double NumOfEdges(void)
  35. {return numOfEdges;}
  36. VerT GetValue(const int i);
  37. int GetWeight(const int v1, const int v2);
  38. void Show(); //输出邻接矩阵结果
  39. void InsertVertex(const VerT &vertex);
  40. void InsertWayEdge(const int v1, const int v2, int weight);
  41. void InsertNoWayEdge(const int v1, const int v2, int weight);
  42. void DeleteVertex(const int v);
  43. void DeleteEdge(const int v1, const int v2);
  44.  
  45. int GetFirstNeighbor(const int v);
  46. int GetNextNeighbor(const int v1, const int v2);
  47.  
  48. void DepthFirstSearch();
  49. void BroadFirstSearch();
  50. };
  51.  
  52. AdjTWGraph::AdjTWGraph(void)
  53. {
  54. for(int i = ; i < MaxVertices; i++) Vertices[i].adj = NULL;
  55. numVertices = ;
  56. numOfEdges = ;
  57. }
  58.  
  59. AdjTWGraph::~AdjTWGraph(void)
  60. {
  61. for(int i = ; i < numVertices; i++)
  62. {
  63. EdgeType *p = Vertices[i].adj, *q;
  64. while(p != NULL)
  65. {
  66. q = p->next;
  67. delete p;
  68. p = q;
  69. }
  70. }
  71. }
  72.  
  73. VerT AdjTWGraph::GetValue(const int i)
  74. {
  75. if(i < || i > numVertices)
  76. {
  77. cout << "参数i越界出错!" << endl;
  78. exit();
  79. }
  80. return Vertices[i].data;
  81. }
  82.  
  83. int AdjTWGraph::GetWeight(const int v1, const int v2)
  84. {
  85.  
  86. if(v1 < || v1 > numVertices || v2 < || v2 > numVertices)
  87. {
  88. cout << "参数v1或v2越界出错!" << endl;
  89. exit();
  90. }
  91. EdgeType *p = Vertices[v1].adj;
  92. while(p != NULL && p->dest < v2)
  93. p = p->next;
  94. if(p==NULL||v2 != p->dest)
  95. {
  96. return MaxWeight;
  97. }
  98. return p->weight;
  99. }
  100.  
  101. void AdjTWGraph::InsertVertex(const VerT &vertex)
  102. {
  103. Vertices[numVertices].data = vertex;
  104. numVertices++;
  105. }
  106.  
  107. void AdjTWGraph::InsertWayEdge(const int v1, const int v2, int weight)
  108. {
  109. if(v1 < || v1 > numVertices || v2 < || v2 > numVertices)
  110. {
  111. cout << "参数v1或v2越界出错!" << endl;
  112. exit();
  113. }
  114.  
  115. EdgeType *q = new EdgeType(v2, weight);
  116. if(Vertices[v1].adj == NULL)
  117. Vertices[v1].adj = q;
  118. else
  119. {
  120. EdgeType *curr = Vertices[v1].adj, *pre = NULL;
  121. while(curr != NULL && curr->dest < v2)
  122. {
  123. pre = curr;
  124. curr = curr->next;
  125. }
  126. if(pre == NULL)
  127. {
  128. q->next = Vertices[v1].adj;
  129. Vertices[v1].adj = q;
  130. }
  131. else
  132. {
  133. q->next = pre->next;
  134. pre->next = q;
  135. }
  136. }
  137. numOfEdges++;
  138. }
  139. void AdjTWGraph::InsertNoWayEdge(const int v1, const int v2, int weight)
  140. //插入一条起始顶点为v1、终止顶点为 v2、权值为weight的边
  141. {
  142. if(v1 < || v1 > numVertices || v2 < || v2 > numVertices)
  143. {
  144. cout << "参数v1或v2越界出错!" << endl;
  145. exit();
  146. }
  147.  
  148. EdgeType *q = new EdgeType(v2, weight);
  149. if(Vertices[v1].adj == NULL)
  150. Vertices[v1].adj = q;
  151. else
  152. {
  153. EdgeType *curr = Vertices[v1].adj, *pre = NULL;
  154. while(curr != NULL && curr->dest < v2)
  155. {
  156. pre = curr;
  157. curr = curr->next;
  158. }
  159. if(pre == NULL)
  160. {
  161. q->next = Vertices[v1].adj;
  162. Vertices[v1].adj = q;
  163. }
  164. else
  165. {
  166. q->next = pre->next;
  167. pre->next = q;
  168. }
  169. }
  170. numOfEdges+=0.5; //边的个数加0.5
  171. }
  172. void AdjTWGraph::DeleteVertex(const int v)
  173. {
  174. EdgeType *pre, *curr;
  175. for(int i = ; i < numVertices; i++)
  176. {
  177. pre = NULL;
  178. curr = Vertices[i].adj;
  179. while(curr != NULL && curr->dest < v)
  180. {
  181. pre = curr;
  182. curr = curr->next;
  183. }
  184.  
  185. if(pre == NULL && curr->dest == v)
  186. {
  187. Vertices[i].adj = curr->next;
  188. delete curr;
  189. numOfEdges--;
  190. }
  191. else if(curr != NULL && curr->dest == v)
  192. {
  193. pre->next = curr->next;
  194. delete curr;
  195. numOfEdges--;
  196. }
  197. }
  198.  
  199. EdgeType *p = Vertices[v].adj, *q;
  200. for(int i = v; i < numVertices-; i++)
  201. Vertices[i] = Vertices[i+];
  202. numVertices--;
  203.  
  204. while(p != NULL)
  205. {
  206. q = p->next;
  207. delete p;
  208. p = q;
  209. numOfEdges--;
  210. }
  211. }
  212.  
  213. void AdjTWGraph::DeleteEdge(const int v1, const int v2)
  214. {
  215. if(v1 < || v1 > numVertices || v2 < || v2 > numVertices)
  216. {
  217. cout << "参数v1或v2越界出错!" << endl;
  218. exit();
  219. }
  220. EdgeType *curr = Vertices[v1].adj, *pre = NULL;
  221. while(curr != NULL && curr->dest < v2)
  222. {
  223. pre = curr;
  224. curr = curr->next;
  225. }
  226. if(pre == NULL && curr->dest == v2)
  227. {
  228. Vertices[v1].adj = curr->next;
  229. delete curr;
  230. numOfEdges--;
  231. }
  232. else if(pre != NULL && curr->dest == v2)
  233. {
  234. pre->next = curr->next;
  235. delete curr;
  236. numOfEdges--;
  237. }
  238. else
  239. {
  240. cout << "边<v1, v2>不存在!" << endl;
  241. exit();
  242. }
  243. }
  244.  
  245. int AdjTWGraph::GetFirstNeighbor(const int v)
  246. {
  247. if(v < || v > numVertices)
  248. {
  249. cout << "参数v1越界出错!" << endl;
  250. exit();
  251. }
  252. EdgeType *p = Vertices[v].adj;
  253. if(p != NULL) return p->dest;
  254. else return -;
  255. }
  256.  
  257. int AdjTWGraph::GetNextNeighbor(const int v1, const int v2)
  258. {
  259. if(v1 < || v1 > numVertices || v2 < || v2 > numVertices)
  260. {
  261. cout << "参数v1或v2越界出错!" << endl;
  262. exit();
  263. }
  264. EdgeType *p = Vertices[v1].adj;
  265. while(p != NULL)
  266. {
  267. if(p->next != NULL && p->dest == v2) return p->next->dest;
  268. else p = p->next;
  269. }
  270. return -;
  271. }
  272.  
  273. void AdjTWGraph::DepthFirstSearch()
  274. {
  275. int *visited = new int[NumOfVertices()];
  276. for(int i = ; i < NumOfVertices(); i++) visited[i] = ;
  277. for(int i = ; i < NumOfVertices(); i++)
  278. if(! visited[i])
  279. DepthFirstSearch(i, visited);
  280. delete []visited;
  281. }
  282.  
  283. void AdjTWGraph::DepthFirstSearch(const int v, int visited[])
  284. {
  285. cout<<GetValue(v)<<" ";
  286. visited[v] = ;
  287.  
  288. int w = GetFirstNeighbor(v);
  289. while(w != -)
  290. {
  291. if(! visited[w])
  292. DepthFirstSearch(w, visited);
  293. w = GetNextNeighbor(v, w);
  294. }
  295. }
  296.  
  297. void AdjTWGraph::BroadFirstSearch()
  298. {
  299. int *visited = new int[NumOfVertices()];
  300. for(int i = ; i < NumOfVertices(); i++) visited[i] = ;
  301. for(int i = ; i < NumOfVertices(); i++)
  302. if(!visited[i]) BroadFirstSearch(i, visited);
  303. delete []visited;
  304. }
  305.  
  306. void AdjTWGraph::BroadFirstSearch(const int v, int visited[])
  307. {
  308. VerT u, w;
  309. SeqQueue queue;
  310. cout<<GetValue(v)<<" ";
  311. visited[v] = ;
  312. queue.Append(v);
  313. while(queue.NotEmpty())
  314. {
  315. u = queue.Delete();
  316. w = GetFirstNeighbor(u);
  317. while(w != -)
  318. {
  319. if(!visited[w])
  320. {
  321. cout<<GetValue(w)<<" ";;
  322. visited[w] = ;
  323. queue.Append(w);
  324. }
  325. w = GetNextNeighbor(u, w);
  326. }
  327. }
  328. }
  329. void AdjTWGraph::Show()
  330. {
  331. for(int i=;i<numVertices;i++)
  332. {
  333. for(int j=;j<numVertices;j++)
  334. {
  335. int a=GetWeight(i,j);
  336. if(a==MaxWeight)
  337. cout<<"∞ ";
  338. else
  339. cout<<a<<" ";
  340. }
  341. cout<<endl;
  342. }
  343. }

CreatAdjTWGraph.h

  1. struct RowColWeight
  2. {
  3. int row; //行下标
  4. int col; //列下标
  5. int weight; //权值
  6. };
  7.  
  8. void CreatWayWeb(AdjTWGraph &G, DataType V[], int n,RowColWeight E[],int e)
  9. //在图G中插入n个顶点V和e条边E
  10. {
  11. //在图G中插入n个顶点
  12. for(int i = ; i < n; i++)
  13. G.InsertVertex(V[i]);
  14.  
  15. //在图G中插入e条边
  16. for(int k = ; k < e; k++)
  17. G.InsertWayEdge(E[k].row, E[k].col, E[k].weight);
  18. }
  19. void CreatNoWayWeb(AdjTWGraph &G, DataType V[],int n,RowColWeight E[], int e)
  20. {
  21. //在图G中插入n个顶点
  22. for(int i = ; i < n; i++)
  23. G.InsertVertex(V[i]);
  24. //在图G中插入e条边
  25. for(int k = ; k < e; k++)
  26. {
  27. if(E[k].row>E[k].col)
  28. {
  29. cout<<"无向网参数输入错误";
  30. exit();
  31. }
  32. G.InsertNoWayEdge(E[k].row, E[k].col, E[k].weight);
  33. G.InsertNoWayEdge(E[k].col, E[k].row, E[k].weight);
  34. }
  35. }

SeqQueue.h

  1. #include<iostream>
  2. using namespace std;
  3. class SeqQueue
  4. {
  5. private:
  6. DataType data[MaxQueueSize]; //顺序队列数组
  7. int front; //队头指示器
  8. int rear; //队尾指示器
  9. int count; //元素个数计数器
  10. public:
  11. SeqQueue(void) //构造函数
  12. {front = rear = ; count = ;};
  13. ~SeqQueue(void){}; //析构函数
  14.  
  15. void Append(const DataType& item); //入队列
  16. DataType Delete(void); //出队列
  17. DataType GetFront(void)const; //取队头数据元素
  18. int NotEmpty(void)const //非空否
  19. {return count != ;};
  20. };
  21.  
  22. void SeqQueue::Append(const DataType& item) //入队列
  23. //把数据元素item插入队列作为当前的新队尾
  24. {
  25. if(count > && front == rear)
  26. {
  27. cout << "队列已满!" << endl;
  28. exit();
  29. }
  30.  
  31. data[rear] = item; //把元素item加在队尾
  32. rear = (rear + ) % MaxQueueSize; ///队尾指示器加1
  33. count++; //计数器加1
  34. }
  35.  
  36. DataType SeqQueue::Delete(void) //出队列
  37. //把队头元素出队列,出队列元素由函数返回
  38. {
  39. if(count == )
  40. {
  41. cout << "队列已空!" << endl;
  42. exit();
  43. }
  44.  
  45. DataType temp = data[front]; //保存原队头元素
  46. front = (front + ) % MaxQueueSize; //队头指示器加1
  47. count--; //计数器减1
  48. return temp; //返回原队头元素
  49. }
  50.  
  51. DataType SeqQueue::GetFront(void)const //取队头数据元素
  52. //取队头元素并由函数返回
  53. {
  54. if(count == )
  55. {
  56. cout << "队列空!" << endl;
  57. exit();
  58. }
  59. return data[front]; //返回队头元素
  60. }

GraphTest.cpp

  1. #include <iostream>
  2. #include <stdlib.h>
  3. const int MaxQueueSize = ;
  4.  
  5. typedef char VerT;
  6. typedef int DistT;
  7. typedef char DataType;
  8.  
  9. #include "AdjTWGraph.h"
  10. #include "CreatAdjTWGraph.h"
  11.  
  12. int main()
  13. {
  14. AdjTWGraph g,f;
  15. char a[] = {'A','B','C','D','E'};
  16. char b[] = {'A','B','C','D','E','F'};
  17.  
  18. RowColWeight r1[] ={{,,},{,,},{,,},{,,},{,,},{,,}};
  19. RowColWeight r2[] ={{,,},{,,},{,,},{,,},{,,},{,,},{,,}};
  20. int n1,n2,e1,e2;
  21. n1=sizeof(a)/sizeof(a[]);
  22. n2=sizeof(b)/sizeof(b[]);
  23. e1=sizeof(r1)/sizeof(r1[]);
  24. e2=sizeof(r2)/sizeof(r2[]);
  25. CreatWayWeb(g, a, n1, r1, e1); //创建有向网
  26. CreatNoWayWeb(f, b, n2, r2, e2); //创建无向网
  27.  
  28. cout<<"有向网:"<<endl;
  29. g.Show();
  30. cout << "\n顶点个数为:" << g.NumOfVertices();
  31. cout << "\n边的条数为:" << g.NumOfEdges();
  32.  
  33. cout << "\n广度优先搜索序列为:";
  34. g.BroadFirstSearch();
  35. cout << "\n深度优先搜索序列为:";
  36. g.DepthFirstSearch();
  37.  
  38. cout<<"\n\n无向网"<<endl;
  39. f.Show();
  40. cout << "\n顶点个数为:" << f.NumOfVertices();
  41. cout << "\n边的条数为:" << f.NumOfEdges();
  42. cout << "\n深度优先搜索序列为:";
  43. f.DepthFirstSearch();
  44. cout << "\n广度优先搜索序列为:";
  45. f.BroadFirstSearch();
  46. return ;
  47. }

最终结果

c++实验10 图的应用实验的更多相关文章

  1. 实验10.3_数值显示拓展_dword型数转变为表示十进制数的字符串

    assume cs:code data segment db 10 dup (0) data ends code segment start : mov ax,4240H;F4240H=1000000 ...

  2. 20162327WJH实验四——图的实现与应用

    20162327WJH实验四--图的实现与应用 实 验 报 告 课程:程序设计与数据结构 班级: 1623 姓名: 王旌含 学号:20162327 成绩: 指导教师:娄嘉鹏 王志强 实验日期:11月2 ...

  3. c++实验9 图及图的操作实验

    实验9 图及图的操作实验 --博客后半部分有程序的所有代码-- 1.图邻接矩阵存储结构表示及基本操作算法实现 (1)邻接矩阵存储结构类定义: #include "SeqList.h" ...

  4. 20145206《Java程序设计》实验二Java面向对象程序设计实验报告

    20145206<Java程序设计>实验二Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O. ...

  5. 20145219 《Java程序设计》实验二 Java面向对象程序设计实验报告

    20145219 <Java程序设计>实验二 Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S. ...

  6. 20145239杜文超 《Java程序设计》实验二 Java面向对象程序设计实验报告

    20145239 <Java程序设计>实验二 Java面向对象程序设计实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S. ...

  7. 实验二 PHP基本语法实验

    实验二 PHP基本语法实验 0 实验准备 0.1实验环境和相关工具软件 具体到的机房环境,请在Windowsxp环境下做本实验: l  操作系统:Windowsxp l  Web服务器:Apache ...

  8. 20145308刘昊阳 《Java程序设计》实验四 Android环境搭建 实验报告

    20145308刘昊阳 <Java程序设计>实验四 Android环境搭建 实验报告 实验名称 Android环境搭建 实验内容 搭建Android环境 运行Android 修改代码,能输 ...

  9. 20145308刘昊阳 《Java程序设计》实验二 Java面向对象程序设计 实验报告

    20145308刘昊阳 <Java程序设计>实验二 Java面向对象程序设计 实验报告 实验名称 Java面向对象程序设计 实验内容 初步掌握单元测试和TDD 理解并掌握面相对象三要素:封 ...

随机推荐

  1. js方法的封装

    封装是为了更好的调用,当我们很多页面都需要同一种方法的时候,为了避免每个页面都需要进行重写方法,增加工作量,这个时候就需要我们对部分公共的方法进行封装,这样便于更好的进行调用 我在写接口的时候用到了 ...

  2. Apache ab测试工具使用方法(无参、get传参、post传参)(转)

    转自Apache ab测试工具使用方法(无参.get传参.post传参) Ab测试工具是apache自带的测试工具,具有简单易上手的特性,下面我总结一下我的使用方法,首先去官方下载apache程序包, ...

  3. ceph对接openstack

    一.使用rbd方式提供存储如下数据: (1)image(glance):保存glanc中的image: (2)volume(cinder)存储:保存cinder的volume:保存创建虚拟机时选择创建 ...

  4. 利用python自动发邮件

    工作中有时长时间运行代码时需要监控进度,或者需要定期发送固定格式邮件时,可以使用下面定义的邮件函数. 该函数调用了outlook和qqmail的接口,只需要放置到python的环境目录中即可 impo ...

  5. java面试01-网络知识

    1.网络七层协议 第一层:物理层 机械.电子.定时接口通信信道上的原始比特流传输 第二层:数据链路层 物理寻址,同时将原始比特流转变为逻辑传输线路 第三层:网络层 控制子网的运行‘如逻辑编址.分组传输 ...

  6. hdu 3549 网络流最大流 Ford-Fulkerson

    Ford-Fulkerson方法依赖于三种重要思想,这三个思想就是:残留网络,增广路径和割. Ford-Fulkerson方法是一种迭代的方法.开始时,对所有的u,v∈V有f(u,v)=0,即初始状态 ...

  7. webpack多页应用

    本文主要讲了webpack怎么搭建多页应用,熟悉下webpack的基本用法. 新建文件夹,目录结构如下: 然后 cd webpack-test npm init(根目录下创建了一个pakage.jso ...

  8. 基于vue模块化开发后台系统——准备工作

    文章目录如下:项目效果预览地址项目开源代码基于vue模块化开发后台系统--准备工作基于vue模块化开发后台系统--构建项目基于vue模块化开发后台系统--权限控制 前言 本文章是以学习为主,练习一下v ...

  9. urllib详细版

    urllib是python内置的处理HTTP请求的库,主要包含以下四个模块 request 模块,是最基本的处理HTTP请求的模块. error 异常处理模块,如果出现请求错误,可以捕获这些错误,保证 ...

  10. wordpress在线预览pdf插件

    插件名称:PDF.js Viewer Shortcode 插件主页:http://tphsfalconer.com/ 优点:功能强大,有分页缩略图功能,翻页,放大缩小,打印,下载,读取等功能. 使用方 ...