2016년 7월 16일 토요일

c언어 자료구조 - 배열을 이용한 리스트2 (ArrayList.h )

2009.05.06

#pragma once
#include <stdio.h>
#include <stdlib.h>
#define MAX_LIST_SIZE 100
typedef int element;
typedef int position;
typedef struct{
 int list[MAX_LIST_SIZE];
 int length;
} ArrayListType;
void error(char *);
void init(ArrayListType *);
int is_empty(ArrayListType *);
int is_full(ArrayListType *);
void add(ArrayListType *, position, element);
//delete 대신 remove로 바꿈 <-- cpp에서는 delete 연산자가 정의되어 있기 때문에
element remove(ArrayListType *, position);
element get_entry(ArrayListType *, position);
position first(ArrayListType *);
position last(ArrayListType *);
position before(ArrayListType *, position);
position after(ArrayListType *, position);


void add_last(ArrayListType *, element );
void add_first(ArrayListType *, element);
void clear(ArrayListType *);
void replace(ArrayListType *, position , element );
int is_in_list(ArrayListType *, element );
int get_length(ArrayListType *);
void ans(int);

댓글 없음:

댓글 쓰기