Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Implementasi linked list, Study notes of Algorithms and Programming

Implementasi linked list struktur data dan algortima teknik infotmatika semester 2

Typology: Study notes

2019/2020

Uploaded on 10/05/2020

FernandoRonero
FernandoRonero 🇮🇩

3 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
IMPLEMENTASI LINKED LIST
pf3

Partial preview of the text

Download Implementasi linked list and more Study notes Algorithms and Programming in PDF only on Docsity!

IMPLEMENTASI LINKED LIST

IMPLEMENTASI LINKED LIST 1. package Pertemuan4LinkedList; 2. 3. import java.util.LinkedList; A. 5. public class ContohSenarai { 6. 7. public static void main(String[] args) { 8. LinkedList senarai = new LinkedList(); 9. Simpul simpul; 16. 11. //Masukkan 5 nama 12. senarai.push(new Simpul("AMN", “Aminudin")); 13. senarai.push(new Simpul("ZAS", “Zaskia")); 14. senarai.push(new Simpul("RIN", “Rina Melati")); 15. senarai.push(new Simpul("FAR", “Farhan™)); 16. senarai.push(new Simpul(“AGN", “Agnes Monica")); 17. 18. System.out.printIn("Keadaan awal"); 19. for (int i = @; i < senarai.size(); i++) { 28. simpul = senarai.get(i); 21. simpul.display(); 22. } 23. 24. hapus(senarai, “RIN"); 25. 26. System.out.printin(); 27. System.out.printin("Setelah RIN dihapus"); 28. for (int i = @; i < senarai-size(); i++) { 29. simpul = senarai.get(i); 38. simpul.display(); 31. }