Created
May 15, 2018 06:15
-
-
Save aldhinya/97c439dcda691e5723502f4de251f86f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void delfront() | |
{ | |
if (awal==NULL) | |
{ | |
cout << "Kosong"; | |
} | |
else if (awal->next==NULL) | |
{ | |
hapus=awal; | |
awal=NULL; | |
akhir=NULL; | |
delete hapus; | |
} | |
else | |
{ | |
hapus=awal; | |
awal=hapus->next; | |
awal->prev=NULL; | |
delete hapus; | |
cout << "Data sudah dihapus." <<endl <<endl; | |
} | |
} | |
void delback() | |
{ | |
if (awal==NULL) | |
{ | |
cout << "Kosong"; | |
} | |
else if (awal->next==NULL) | |
{ | |
hapus=awal; | |
awal=NULL; | |
akhir=NULL; | |
delete hapus; | |
} | |
else | |
{ | |
hapus=akhir; | |
akhir=hapus->prev; | |
akhir->next=NULL; | |
delete hapus; | |
cout << "Data sudah dihapus." <<endl <<endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment