[c언어] 연결리스트


[c언어] 연결리스트

연결 리스트는 리스트를 연결시켜 연결 자료구조로 표현한 구조입니다. 연결하는 방식에 따라 단순 연결 리스트, 원형 연결 리스트, 이중 연결 리스트, 이중 원형 연결 리스트로 나눕니다. 이번 시간에는 단순 연결 리스트 프로그램을 구현해봤습니다. 간단한 예시로 Kim, Choi, Lee 순서로 나열되는 연결 리스트를 만들어보겠습니다. #include <stdio.h> #include <string.h> typedef struct Customer Customer; struct Customer{ char id[32]; Customer *next; }; int main(){ Customer c1, c2, c3; strcpy(c1.id, "Kim"); c1.next= &c2; strcpy(c2.id, "Choi"); c2.next= &c3; strcpy(c3.id, "Lee"); c3.next = NULL; Customer *p; int i=0; for(p=&c1; p!=NULL; p=p->n...


#c언어 #LinkedList #연결리스트 #자료구조 #프로그래밍

원문링크 : [c언어] 연결리스트