알고리즘/이론

인접 리스트 방식 그래프 #pragma once #ifndef GRAPH_H #define GRAPH_H #include #include enum VisitedMode { Visited, NotVisited }; typedef int ElementType; typedef struct tagVertex { ElementType Data; int Visited; int Index; struct tagVertex* Next; struct tagEdge* AdjacenyList; } Vertex; typedef struct tagEdge { int Weight; struct tagEdge* Next; Vertex* From; Vertex* Target; } Edge; typedef struct tagGraph ..
LCRS(Left Child Right Sibling) 트리 #pragma once #ifndef LCRSTREE_H #define LCRSTREE_H #include #include typedef char ElementType; typedef struct tagLCRSNode { struct tagLCRSNode* LeftChild; struct tagLCRSNode* RightSibling; ElementType Data; }LCRSNode; LCRSNode* LCRS_CreateNode(ElementType NewData); void LCRS_DestroyNode(LCRSNode* Node); void LCRS_AddChildNode(LCRSNode* Parent, LCRSNode* Child); ..
#pragma once #ifndef CIRCULAR_QUEUE_H #define CIRCULAR_QUEUE_H #include #include typedef int ElementType; typedef struct tagNode { ElementType Data; }Node; typedef struct tagCircularQueue { int Capacity; int Front; int Rear; Node* Nodes; } CircularQueue; void CQ_CreateQueue(CircularQueue** Queue, int Capacity); void CQ_DestroyQueue(CircularQueue* Queue); void CQ_Enqueue(CircularQueue* Queue, Ele..
#pragma once #ifndef ARRAYSTACK_H #define ARRAYSTACK_H #include #include typedef int ElementType; typedef struct tagNode { ElementType Data; } Node; typedef struct tagArrayStack { int Capacity; int Top; Node* Nodes; }ArrayStack; void AS_CreateStack(ArrayStack** Stack, int Capacity); void AS_DestroyStack(ArrayStack* Stack); void AS_Push(ArrayStack* Stack, ElementType Data); ElementType AS_Pop(Arr..
오뚜깅
'알고리즘/이론' 카테고리의 글 목록