11/11/22 20:56:42.46
>>534の続き
課題9 解答例
struct cell *locateCell(int data, struct cell *list)
{
struct cell *current;
current = firstCell(list);
while ((current != (struct cell*)NULL)
&& (retrieveCell(current, list) != data)) {
current = nextCell(current, list);
}
return current;
}
プロトタイプ宣言
struct cell *makeNullList(void);
struct cell *nextCell(struct cell *, struct cell *);
struct cell *firstCell(struct cell *);
struct cell *endCell(struct cell *);
struct cell *previousCell(struct cell *, struct cell *);
struct cell *insertCell(int, struct cell *, struct cell *);
struct cell *deleteCell(struct cell *, struct cell *);
int retrieveCell(struct cell *, struct cell *);
struct cell *locateCell(int, struct cell *);
void deletelist(struct cell *);
void printlist(struct cell *);