Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "DLL.cpp"
- using namespace std;
- int main(){
- List data,data2,data3,datasong;
- createList(data);
- createList(data2);
- createList(datasong);
- address num1 = new elmList;
- address num2 = new elmList;
- address num3 = new elmList;
- address num4 = new elmList;
- address num5 = new elmList;
- address num6 = new elmList;
- createNewElement(1,num1);
- createNewElement(2,num2);
- createNewElement(3,num3);
- createNewElement(4,num4);
- createNewElement(5,num5);
- createNewElement(6,num6);
- //data 1
- cout<<"Insert First"<<endl;
- insertFirst(data,num1);
- printInfo(data);
- cout<<"Insert Last"<<endl;
- insertLast(data,num2);
- printInfo(data);
- cout<<"Insert Last"<<endl;
- insertLast(data,num4);
- printInfo(data);
- cout<<"Insert After 2"<<endl;
- inserAfter(data,num2,num3);
- printInfo(data);
- //data2
- insertLast(data2,num5);
- insertLast(data2,num6);
- address del1 = new elmList;
- deleteFirst(data,del1);
- cout<<"Data yang didelete : " << info(del1) << endl;
- printInfo(data);
- address del3 = new elmList;
- deleteAfter(data,num2,del3);
- cout<<"Data yang didelete : " << info(del3) << endl;
- printInfo(data);
- address del4 = new elmList;
- deleteLast(data,del4);
- cout<<"Data yang didelete : " << info(del4) << endl;
- printInfo(data);
- cout<<"Data 1"<<endl;
- printInfo(data);
- cout<<"Data 2"<<endl;
- printInfo(data2);
- concat(data,data2,data3);
- cout<<"Concat"<<endl;
- printInfo(data3);
- address song1 = new elmList;
- address song2 = new elmList;
- address song3 = new elmList;
- address song4 = new elmList;
- createNewSong(1,"hold me",song1);
- createNewSong(2,"press me",song2);
- createNewSong(3,"kill me",song3);
- createNewSong(4,"stress me",song4);
- insertLast(datasong,song1);
- insertLast(datasong,song2);
- insertLast(datasong,song3);
- insertLast(datasong,song4);
- cout<<"Data lagu"<<endl;
- printInfo(datasong);
- cout<<"Mencari lagu press me"<<endl;
- address cari = getSongAddress("press me",datasong);
- cout<<"Id yang didapat : "<< info(cari) <<endl<<endl;
- cout<<"Delete lagu kill me"<<endl;
- removeLagu("kill me",datasong);
- cout<<"Hasil setelahnya lagu"<<endl;
- printInfo(datasong);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement