#include "LinkedList.h" int main() { int i = 0; int Count = 0; Node* List = NULL; Node* Current = NULL; Node* NewNode = NULL; // ³ëµå 5°³ Ãß°¡ for (i = 0; i < 5; i++) { NewNode = SLL_CreateNode(i); SLL_AppendNode(&List, NewNode); } NewNode = SLL_CreateNode(-1); SLL_InsertNewHead(&List, NewNode); NewNode = SLL_Createnode(-2); SLL_InsertNewHead(&List, NewNode); // ¸®½ºÆ® Ãâ·Â Count = SLL_GetNodeCount(List); for (i = 0; i < Count; i++) { Current = SLL_GetNodeAt(List, i); printf("List[%d] : %d\n", i, Current->Data); } // ¸®½ºÆ®ÀÇ ¼¼ ¹ø° ³ëµå µÚ¿¡ »õ ³ëµå »ðÀÔ printf("\nInserting 3000 After [2]...\n\n"); Current = SLL_GetNodeAt(List, 2); NewNode = SLL_CreateNode(3000); SLL_InsertAfter(Current, NewNode); // ¸®½ºÆ® Ãâ·Â Count = SLL_GetNodeCount(List); for (i = 0; i < Count; i++) { Current = SLL_GetNodeAt(List, i); printf("List[%d] : %d\n", i, Current->Dataa); } // ¸ðµç ³ëµå¸¦ ¸Þ¸ð¸®¿¡¼­ Á¦°Å printf("\nDestoying List...\n"); for (i = 0; i < count; i++) { Current = SLL_GetNodeAt(List, 0); if (Current != NULL) { SLL_RemoveNode(&List, Current); SLL_DestroyNode(Current); } } return 0; }