[과제031] 단일 연결 리스트(Single Linked List)(09-04-12)
단일 연결 리스트(Single Linked List) 구현
==== main 함수 ====
void main()
{
LinkedList<int> linkedlist;
linkedlist.InsertFirst(1);
linkedlist.InsertFirst(2);
linkedlist.InsertLast(3);
linkedlist.Insert(1, 4);
linkedlist.DeleteLast();
linkedlist.Delete(2);
linkedlist.InsertLast(5);
linkedlist.InsertLast(6);
linkedlist.Insert(4, 7);
linkedlist.DeleteFirst();
cout<<"linkedlist.InsertFirst(1)"<<endl;
cout<<"linkedlist.InsertFirst(2)"<<endl;
cout<<"linkedlist.InsertLast(3)"<<endl;
cout<<"linkedlist.Insert(1, 4)"<<endl;
cout<<"linkedlist.DeleteLast()"<<endl;
cout<<"linkedlist.Delete(2)"<<endl;
cout<<"linkedlist.InsertLast(5)"<<endl;
cout<<"linkedlist.InsertLast(6)"<<endl;
cout<<"linkedlist.Insert(4, 7)"<<endl;
cout<<"linkedlist.DeleteFirst()"<<endl;
linkedlist.Print();
linkedlist.DeleteAll();
cout<<"linkedlist.DeleteAll()"<<endl;
linkedlist.Print();
system("PAUSE");
}
'Subject > 자료구조' 카테고리의 다른 글
[과제036] BST 구현(09-04-19) (2) | 2010.03.02 |
---|---|
[과제035] 정렬 알고리즘 구현(09-04-17) (0) | 2010.03.02 |
[과제034] 이진 탐색 알고리즘 구현(09-04-16) (0) | 2010.03.02 |
[과제033] 배열/동적할당 Single Linked List 구현/속도비교(09-04-15) (0) | 2010.03.02 |
[과제032] Queue/Stack 구현(09-04-12) (0) | 2010.03.02 |