Skip to content

Instantly share code, notes, and snippets.

@aldhinya
Created May 15, 2018 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldhinya/97c439dcda691e5723502f4de251f86f to your computer and use it in GitHub Desktop.
Save aldhinya/97c439dcda691e5723502f4de251f86f to your computer and use it in GitHub Desktop.
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