Linked List를 이용한 Queue 구현
- 최초 등록일
- 2005.01.15
- 최종 저작일
- 2005.01
- 압축파일
- 가격 1,500원
소개글
Queue를 Linked List를 이용해 만들었습니다. 그리고, 관계형 함수 포인터를 이용하여 만들었습니다. 이 방법의 좋은점은 본인이 필요한 함수를 얼마든지 만들어서 Test파일에서 구현한데로 가져다가 쓰기만하면 됩니다. 보기에도 편하고, 알아보기 쉽게 만들었고, 주석도 달아놓았습니다.
컴파일 실행환경
visual studio에서 실행하면 됩니다.
프로젝트 파일을 실행하세요!!!
본문내용
/*
CreateDll 함수
함 수 명 : CreateDll
호출 함수 :
전달 인수 : 없음
반 환 값 : 없음
*/
void CreateDll(DLL *pSelf)
{
pSelf ->head = (NODE *)malloc(sizeof(NODE));
pSelf ->tail = (NODE *)malloc(sizeof(NODE));
pSelf ->head ->llink = pSelf ->head;
pSelf ->tail ->rlink = pSelf ->tail;
pSelf ->head ->rlink = pSelf ->tail;
pSelf ->tail ->llink = pSelf ->head;
pSelf ->count = 0;
pSelf ->position = pSelf ->head ->rlink;
/* 관계성을 위한 함수형 Pointer 변수 */
/*부연 설명 : 정의한 함수가 '='다음에 오는 이름에 와서 pSelf의 멤버함수의 선언부를 이용한다.*/
pSelf ->DestroyDll = DestroyDll;
pSelf ->InsertHeadDll = InsertHeadDll;
pSelf ->InsertTailDll = InsertTailDll;
pSelf ->InsertAtDll = InsertAtDll;
pSelf ->InsertPositionDll = InsertPositionDll;
pSelf ->InsertSortDll = InsertSortDll;
pSelf ->DeleteHeadDll = DeleteHeadDll;
pSelf ->DeleteTailDll = DeleteTailDll;
pSelf ->DeleteAtDll = DeleteAtDll;
pSelf ->DeletePositionDll = DeletePositionDll;
pSelf ->DeleteAllDll = DeleteAllDll;
pSelf ->GetCurrentPosition = GetCurrentPosition;
pSelf ->GetCount = GetCount;
pSelf ->SetAtDll = SetAtDll;
pSelf ->PrintDll = PrintDll;
pSelf ->MoveFirst = MoveFirst;
pSelf ->MoveLast = MoveLast;
pSelf ->MoveNext = MoveNext;
pSelf ->MovePrevious = MovePrevious;
return;
}
압축파일 내 파일목록
Queue_Dll.dsp
Queue_Dll.dsw
Queue_Dll.ncb
Queue_Dll.plg
Node.h
DLL.h
Queue_Dll.h
DLL.c
Queue_Dll_Test.c
Queue_Dll.c
Queue_Dll.opt
참고 자료
없음