Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void hapusTengah()
- {
- int cari,depan;
- hapus = head; // letakan hapus pada head
- cout<<"NIM yang akan dihapus : ";
- cin>>cari;
- if(isEmpty()==0)
- {
- while (hapus->next != NULL && hapus->NIM != cari)
- hapus = hapus->next;
- if (hapus->NIM == cari)
- {
- bantu2 = hapus->next;
- bantu = hapus->prev;
- if (head != hapus)
- bantu->next = bantu2;
- else
- head = bantu2;
- if (tail != hapus)
- bantu2->prev = bantu;
- else
- tail = bantu;
- delete hapus;
- }
- }
- else
- {
- cout<<"Tabel masih kosong"<<endl;
- int nomor=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement