목록Software Engineering/Programming (18)
Pure Software Engineer :)
DisjointSet.h #ifndef DISJOINTSET_H_ #define DISJOINTSET_H_ #include #include typedef struct tagDisjointSet { struct tagDisjointSet* Parent; void* Data; }DisjointSet; void DS_UnionSet(DisjointSet* Set1, DisjointSet* Set2); DisjointSet* DS_FindSet(DisjointSet* Set); DisjointSet* DS_MakeSet(void* NewData); void DS_DestroySet(DisjointSet* Set); #endif DisjointSet.c #include "DisjointSet.h" void DS_..
BinaryTree.h #ifndef BINARY_TREE_H #define BINARY_TREE_H #include #include Left = NULL; NewNode->Right = NULL; NewNode->Data = NewData; return NewNode; } void SBT_DestroyNode(SBTNode* Node) { free(Node); } void SBT_DestroyTree(SBTNode* Node) { if(Node == NULL) return; // 왼쪽 하위 트리 소멸 SBT_DestroyTree(Node->Left); // 오른쪽 하위 트리 소멸 SBT_DestroyTree(Node->Right); // 루트 노드 소멸 SBT_DestroyNode(Node); } vo..