TaskForce 썸네일형 리스트형 20191110-bfs #include #include #include int n; int map[100][100]; int checkMap[100][100]; struct pointData { int x; int y; int level; int currentIdx; int prevIdx; }; class Queue { public: pointData data[100]={{0,0,0,0,0}}; int front; int rear; Queue() { front = 0; rear = 0; } void enqueue(pointData pData){ pData.currentIdx = rear; data[rear++] = pData; //printf("enqueue: %d ; level:%d %d, %d\n",rear, pData.l.. 20191102 #include #include #include #define MAX 100 struct Node { char name; int idx; int nextIdx[MAX]; int linkedNum = 0; }; struct Stack { int top; int bottom; Node data[MAX]; }; struct Graph { Node vertex[MAX]; int visitCheck[MAX]; int size; }graph; void initStack(Stack *s) { s->top = 0; s->bottom = 0; } void push(Stack *s, Node node) { s->data[s->top] = node; s->top++; } void pop(Stack *s) { s->top--.. 이전 1 다음