소스랑 헤더파일이 많으면 안되나요?
퐁당
ctrl+F5를 눌러서 오류 있는지 확인 해봤습니다 왜 안될까요-------bintreelinkedqueue.h
#ifndef _LINKED_DEQUE_
#define _LINKED_DEQUE_
#include bintree.htypedef struct queueNodeType{
binTree* data;
struct dequeNodeType* pLink;
}queueNode;
typedef struct linkedQueueType{
int currentElementCount;
queueNode* pFrontNode;
queueNode* pRearNode;
}linkedQueue;
linkedQueue* createLinkedQueue();
int enqueueLQ(linkedQueue* pQueue,queueNode element);
queueNode* dequeueLQ(linkedQueue* pQueue);
queueNode* dequeueLQ(linkedQueue* pQueue);
void deleteLinkedQueue(linkedQueue* pQueue);
int isLinkedQueueFull(linkedQueue* pQueue);
int isLinkedQueueEmpty(linkedQueue* pQueue);
#endif
#ifndef _COMMON_QUEUE_DEF_
#define _COMMON_QUEUE_DEF_
#define TRUE 1
#define FALSE 0
#endif
--------------------------------------bintreelinkedstack.h
#ifndef _LINKED_STACK_
#define _LINKED_STACK_
#include bintree.htypedef struct stackNodeType{
binTree *data;
struct stackNodetype *pLink;
}stackNode;
typedef struct LinkedStackNode{
int currentElementCount;
stackNode* pTopElement;
}linkedStack;
linkedStack* createLinkedStack();
int pushLS(linkedStack* pStack,stackNode element);
stackNode* popLS(linkedStack* pStack);
stackNode* peekLS(linkedStack* pStack);
void deleteLinkedStack(linkedStack *pStack);
int isLinkedStackFull(linkedStack* pStack);
int isLinkedStackEmpty(linkedStack* pStack);#endif
#ifndef _COMMON_STACK_DEF_
#define _COMMON_STACK_DEF_
#define TRUE 1
#define FALSE 0
#endif
--------bintreetraversal.h
#ifndef BINTREE_TRAVERSAL_
#define BINTREE_TRAVERSAL_
void preorderTraversalBinTree(binTree *pBinTree);
void inorderTraversalBinTree(binTree *pBinTree);
void postorderTraversalBinTree(binTree *pBinTree);
void levelOrderTraversalBinTree(binTree *pBinTree);
#endif
--------bintree.h
#ifndef _BIN_TREE_
#define _BIN_TREE_
typedef struct BinTreeNodeType
{
char date;
int n;
struct BinTreeNodeType* pLeftChild;
struct BinTreeNodeType* pRightChild;
}binTreeNode;
typedef struct BinTreeType
{
binTreeNode* pbinRootNode;
}binTree;
binTree* makeBinTree(binTreeNode rootNode);
binTreeNode* getRootNodeBT(binTree* pBinTree);
binTreeNode* insertLeftChildNodeBT(binTreeNode* pParentNode,binTreeNode element);
binTreeNode* insertRightChildNodeBT(binTreeNode* pParentNode,binTreeNode element);
binTreeNode* getLeftChildNodeBT(binTreeNode* pNode);
binTreeNode* getRightChildNodeBT(binTreeNode* pNode);
void deleteBinTree(binTree* pBinTree);
void deleteBinTreeNode(binTreeNode* pNode);
#endif
#ifndef _COMMON_TREE_DEF_
#define _COMMON_TREE_DEF_
#define TREE 1
#define FALSE 0
#endif----------------bintree.c
nclude bintree.h
#include stdio.h
#include stdlib.hbinTree* makeBinTree(binTreeNode rootNode){
binTree* pReturn=NULL;
pReturn=(binTree*)malloc(sizeof(binTree));
if(pReturn!=NULL){
pReturn-pbinRootNode=(binTreeNode*)malloc(sizeof(binTreeNode));
if(pReturn-pbinRootNode!=NULL){
*(pReturn-pbinRootNode)=rootNode;
pReturn-pbinRootNode-pLeftChild=NULL;
pReturn-pbinRootNode-pRightChild=NULL;
}
else{
puts(error makeBinTree(pReturn-pbinRootNode=NULL));
pReturn=NULL;
}
}
else{
puts(error makeBinTree(pReturn=NULL));
pReturn=NULL;
}
return pReturn;}
binTreeNode* getRootNodeBT(binTree* pBinTree){
binTreeNode* pReturn=NULL;
if(pBinTree!=NULL)
pReturn=pBinTree-pbinRootNode;
return pReturn;
}
binTreeNode* insertLeftChildNodeBT(binTreeNode* pParentNode,binTreeNode element){
binTreeNode* pReturn=NULL;
if(pParentNode!=NULL){
pParentNode-pLeftChild=(binTreeNode*)malloc(sizeof(binTreeNode));
if(pParentNode-pLeftChild!=NULL){
*(pParentNode-pLeftChild)=element;
pParentNode-pLeftChild-pLeftChild=NULL;
pParentNode-pLeftChild-pRightChild=NULL;
pReturn=pParentNode-pLeftChild;
}
else
puts(error insertLeftChildNodeBT(pParentNode-pLeftChild=NULL));}
else
puts(error insertLeftChildNodeBT(pParentNode=NULL));
return pReturn;
}
binTreeNode* insertRightChildNodeBT(binTreeNode* pParentNode,binTreeNode element){
binTreeNode* pReturn=NULL;
if(pParentNode!=NULL){
pParentNode-pRightChild=(binTreeNode*)malloc(sizeof(binTreeNode));
if(pParentNode-pRightChild!=NULL){
*(pParentNode-pLeftChild)=element;
pParentNode-pRightChild-pLeftChild=NULL;
pParentNode-pRightChild-pRightChild=NUChild=NULL;
pReturn=pParentNode-pRightChild;
}
else
puts(error insertRightChildNodeBT(pParentNode-pRightChild=NULL));}
else
puts(error insertRightChildNodeBT(pParentNode=NULL));
return pReturn;
}
binTreeNode* getLeftChildNodeBT(binTreeNode* pNode){
binTreeNode* pReturn=NULL;
if(pNode!=NULL)
pReturn=pNode-pLeftChild;
return pReturn;
}
binTreeNode* getRightChildNodeBT(binTreeNode* pNode){
binTreeNode* pReturn=NULL;
if(pNode!=NULL)
pReturn=pNode-pRightChild;
return pReturn;
}
void deleteBinTreeNode(binTreeNode* pNode){
if(pNode!=NULL){
deleteBinTreeNode(pNode-pLeftChild);
deleteBinTreeNode(pNode-pRightChild);
free(pNode);
}
}
void deleteBinTree(binTree* pBinTree){
if(pBinTree!=NULL){
deleteBinTreeNode(pBinTree-pbinRootNode);
free(pBinTree);
}
}
------------bintreelinkedqueue.c
#include stdio.h
#include stdlib.h
#include string.h
#include bintreelinkedqueue.h
linkedQueue* createLinkedQueue(){
linkedQueue *pReturn=NULL;
pReturn=(linkedQueue*)malloc(sizeof(linkedQueue));
if(pReturn!=NULL){
memset(pReturn,0,sizeof(linkedQueue));
pReturn-pFrontNode=NULL;
pReturn-pRearNode=NULL;
}
else
puts(error creteLinkedQueue(memory erorr));
return pReturn;
}
int enqueueLQ(linkedQueue* pQueue,queueNode element){
int ret=FALSE;
if(pQueue!=NULL){
queueNode *pNode=NULL;
pNode=(queueNode*)malloc(sizeof(queueNode));
if(pNode!=NULL){
*pNode=element;
pNode-pLink=NULL;
if(pQueue-currentElementCount==0){
pQueue-pFrontNode=pNode;
pQueue-pRearNode=pNode;
}
else{
pQueue-pRearNode-pLink=pNode;
pQueue-pRearNode=pNode;
}
pQueue-currentElementCount++;
ret=TRUE;
}
else
puts(erorr enqueueLQ(pNode=NULL, memory erorr));
}
else
puts(erorr enqueueLQ(pQueue=NULL, memory erorr));
return ret;
}
queueNode* dequeueLQ(linkedQueue* pQueue){
queueNode *pReturn=NULL;
if(pQueue!=NULL){
pReturn=pQueue-pFrontNode;
pQueue-pFrontNode=pQueue-pFrontNode-pLink;
pReturn-pLink=NULL;
pQueue-currentElementCount--;
}
else
puts(erorr dequeueLQ(pQueue=NULL));
return pReturn;
}
void deleteLinkedQueue(linkedQueue* pQueue){
queueNode *pNode=NULL,*pDelNode=NULL;
if(pQueue!=NULL){
pNode=pQueue-pFrontNode;
while(pNode!=NULL){
pDelNode=pNode;
pNode=pNode-pLink;
free(pDelNode);
}
free(pQueue);
}
else
puts(erorr deleteLinkedQueue(pQueue=NULL));
}
int isLinkedQueueFull(linkedQueue* pQueue){
int ret=FALSE;
return ret;
}
int isLinkedQueueEmpty(linkedQueue* pQueue){
int ret=FALSE;
if(pQueue!=NULL){
if(pQueue-currentElementCount==0)
ret=TRUE;
}
else
puts(erorr isLinkedQueueEmpty(pQueue=NULL));
return ret;
}------bintreelinkedstack.c
#include bintreelinkedstack.h
#include stdio.h
#include stdlib.h
#include string.h
linkedStack* createLinkedStack(){
linkedStack* pReturn=NULL;
pReturn=(linkedStack*)malloc(sizeof(linkedStack));
if(pReturn!=NULL){
memset(pReturn,0,sizeof(linkedStack));
pReturn-pTopElement=NULL;
}
else
puts(erorr createLinkedstack(pReturn=NULL));
return pReturn;
}
int pushLS(linkedStack* pStack,stackNode element){
int ret=FALSE;
stackNode* pNode=NULL;
if(pStack!=NULL){
pNode=(stackNode*)malloc(sizeof(stackNode));
*(pNode)=element;
pNode-pLink=pStack-pTopElement;
pStack-pTopElement=pNode;
pStack-currentElementCount++;
ret=TRUE;
}
else
puts(error pushLS(pStack=NULL));
return ret;
}
stackNode* popLS(linkedStack* pStack){
stackNode* pReturn=NULL;
if(pStack!=NULL){
if(isLinkedStackEmpty(pStack)==FALSE){
pReturn=pStack-pTopElement;
pStack-pTopElement=pStack-pTopElement-pLink;
pStack-currentElementCount--;
pReturn-pLink=NULL;
}
else
puts(erorr popLS(Linkedstackisempty));
}
return pReturn;}
stackNode* peekLS(linkedStack* pStack){
stackNode* pReturn=NULL;
if(pStack!=NULL){
if(isLinkedStackEmpty(pStack)=FALSE)
pReturn=pStack-pTopElement;
else
puts(error peekLS(Linkedstackisempty));
}
return pReturn;
}
void deleteLinkedStack(linkedStack *pStack){
stackNode *pNode=NULL,*pDelNode=NULL;
if(pStack!=NULL){
pNode=pStack-pTopElement;
while(pNode!=NULL){
pDelNode=pNode;
pNode=pNode-pLink;
free(pDelNode);
}
free(pStack);
}
}
int isLinkedStackEmpty(linkedStack* pStack){
int ret=FALSE;
if(pStack!=NULL){
if(pStack-currentElementCount==0)
ret=TRUE;
}
else
puts(error isLinkedStackEmpty(pStack=NULL));
return ret;
}
int isLinkedStackFull(linkedStack* pStack){
int ret=FALSE;
return ret;
}-------bintreetraversal.c
#include stdio.h
#include stdlib.h
#include bintree.h
#include bintreelinkedstack.h
#include bintreelinkedqueue.h
#include bintreetraversal.c
int 하는중이 였음
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2700530 | 전처리문 질문입니다. (1) | 아놀드 | 2025-07-05 |
2700510 | c언어를 어케하면 잘할수 있을까요.. | 연연두 | 2025-07-05 |
2700484 | 두 개가 차이가 뭔지 알려주세요...(소수 찾는 프로그램) (2) | 날위해 | 2025-07-05 |
2700426 | 인터넷 창 띄우는 질문이요 (1) | 정훈 | 2025-07-04 |
2700400 | 원넓이를 계산이요 ㅜㅜ | 천칭자리 | 2025-07-04 |
2700368 | if에 관해서 질문이요... | Orange | 2025-07-04 |
2700339 | 이거 결과값이 왜이런건지.. (4) | 그댸와나 | 2025-07-04 |
2700313 | 파일 읽어서 저장하는데 빈파일일 경우 문재가 발생하네요.. (2) | 크나 | 2025-07-03 |
2700287 | 구조체 동적할당 연습을 하는데 오류가 뜹니다...(해결) (3) | 아련나래 | 2025-07-03 |
2700264 | 문자와 숫자 동시에 입력??? | 글고운 | 2025-07-03 |
2700236 | txt파일로만 쓰고 읽게 하려면 어떻게 해야 하나요..?? (8) | 미국녀 | 2025-07-03 |
2700211 | 전위 연산자 (2) | 어른처럼 | 2025-07-02 |
2700183 | C에서 파일이름을 받고, 그 파일의 사이즈를 출력해줘야하는데 내용이 출력이 안되네요 ;ㅅ; | 피스케스 | 2025-07-02 |
2700150 | 꼭좀 도와주세요ㅠㅠㅠ | 호습다 | 2025-07-02 |
2700095 | 연산문제...질문... | 오빤테앵겨 | 2025-07-01 |
2700070 | while문 , 3의배수 출력하는 프로그램좀 짜주세욤. | 횃불 | 2025-07-01 |
2700041 | 초보인데요 ㅎ 배열안에 배열을 집어넣을수 있나요?? | 헛장사 | 2025-07-01 |
2700012 | 배열// (1) | 전갈자리 | 2025-07-01 |
2699895 | 무한루프에 빠집니다.!! 해결좀부탁드려요 (10) | 선아 | 2025-06-30 |
2699842 | 질문을 너무 많이 하네여.....죄송.... (2) | 해님꽃 | 2025-06-29 |