
数据结构
文章平均质量分 67
rambo_ghaip
专注c,c++
展开
-
链表实现
#includeclass node{public: int data; node *plink;};class List{public: node *head;public: List() { head = NULL; } ~List() { node *temp; while(head) { temp = head->plink; delete head; head =原创 2010-01-28 17:08:00 · 405 阅读 · 0 评论 -
队列实现
#includeclass node{public: int data; node *plink;};class List{public: node *head;public: List() { head = NULL; } ~List() { node *temp; while(head) { temp = head->plink; delete head; head =原创 2010-01-28 17:10:00 · 426 阅读 · 0 评论 -
栈实现
#includeclass node{public: int data; node *plink;};class List{public: node *head;public: List() { head = NULL; } ~List() { node *temp; while(head) { temp = head->plink; delete head; head =原创 2010-01-28 17:09:00 · 474 阅读 · 0 评论 -
简单排序
#includevoid BubbleSort(int *num){ for(int i=1; i { for(int j=6-1; j>=1; j--) { if(num[j] > num[j+1]) { int temp = 0; temp = num[j]; num[j] = num[j+1]; num[j+1] = temp; } } }原创 2010-01-28 17:12:00 · 420 阅读 · 0 评论