- 博客(6)
- 收藏
- 关注
原创 图的DFS实现
#include#include "malloc.h"using namespace std;#define Max 100//邻接表实现图的DFS//邻接表每一个链表节点的结构,有一个指向下一个节点的指针,一个存放权值的结构,一个存放节点的信息typedef struct node{ int data; struct node* next; int info; }li
2015-09-12 16:03:06 359
原创 C++实现图的邻接表
#include#include "malloc.h"using namespace std;#define Max 100//邻接表实现图的DFS//邻接表每一个链表节点的结构,有一个指向下一个节点的指针,一个存放权值的结构,一个存放节点的信息typedef struct node{ int data; struct node* next; int info; }li
2015-09-11 21:17:31 1476
原创 c++实现顺序存储的队列
#include#include "malloc.h"using namespace std;#define MaxSize 100typedef struct queuenode{ int data[MaxSize]; int front,rear;}queue;void InitQueue(queue * &q){ q = (queue*)malloc(sizeof(qu
2015-09-11 16:27:15 447
原创 CCF 窗口
按照题意完成了功能,仅供参考#includeusing namespace std;struct window{ int x1,x2,y1,y2;};int compareTop(int num[],int n,int flag[]){ int max = 0; int level = 0; for(int t = 0;t<n;t++) {
2015-09-11 14:42:29 754
原创 CCF 相反数
自己写的实现,未采用用空间换时间的方案,采用了排序的方式,效率不高,仅供参考#include#include#include#include "math.h"using namespace std; int main(){ int N; cin>>N; int i = 0; map > groups; for(;i<N;i++) { int tempt
2015-09-11 14:38:59 447
原创 c++ 顺序存储和链表存储 栈的实现代码
#include#include "malloc.h"using namespace std;#define Order#ifdef Order#define Max 100typedef struct linknode{ int top; int data[Max];}Stack;void InitStack(Stack * &s){ cout<<"数
2015-09-11 14:36:59 444
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人