이중연결리스트
- 최초 등록일
- 2006.10.12
- 최종 저작일
- 2006.01
- 텍스트
- 가격 1,000원
소개글
이중연결리스트로 작성된 헤더 파일..
메인함수위에 덮어 씌워도 가능..
컴파일 실행환경
vc++
본문내용
typedef struct _node
{
char *key;
int length;
struct _node * prev;
struct _node * next;
}node;
node * head, *tail;
void init_queue(void)
{
head = (node*)malloc(sizeof(node));
tail = (node*)malloc(sizeof(node));
head->prev = head;
head->next = tail;
tail->prev = head;
tail->prev = tail;
}
void clear_queue(void)
{
node *t;
node *s;
t= head->next;
while(t != tail)
{
s = t;
t = t->next;
free(s);
}
head->next = tail;
tail->prev = head;
}
int put(char *k,int n)
{
node *t;
if((t=(node *)malloc(sizeof(node))) == NULL)
{
printf("\n out of memory.");
return 0;
}
참고 자료
없음