Documente Academic
Documente Profesional
Documente Cultură
ACTIVITY 05
IMPLEMENTING LINKED LIST
LEARNING OUTCOME:
1. Use the basic operations of a Java LinkedList data structure to create a simple file handling
program.
INSTRUCTIONS:
Using the Java LinkedList, create a simple masterlist of information of any sort (similar to file handling,
say for example, a phonebook). Use the Java LinkedList operations in appending, deleting, or retrieving
the elements. However, you have to create a separate class that will hold the details of your masterlist of
information (which contains the attributes necessary to describe that class).
For example, I created a class named PhoneBook with the necessary attributes (name, phone number,
email address). Then I use the PhoneBook class as a user-defined type in order for the list to hold not
only a single item in one node but the complete attributes of the class. Hence, when the Java LinkedList
will be instantiated with an instance name MyContacts, the data type used in the instantiation of
MyContacts is PhoneBook. This means that MyContacts is a linked list of type PhoneBook.
The program shall allow the user whether to insert a node, delete a node, retrieve the details of a certain
node, or display the complete masterlist. Since phonebook file is used as an example, do not anymore
use this in your program.
To illustrate:
MyContacts
head = 1000 0001
1
Misamis University
Ozamiz City 7200
ACTIVITY 05
IMPLEMENTING LINKED LIST
2
Misamis University
Ozamiz City 7200
ACTIVITY 05
IMPLEMENTING LINKED LIST
program inappropriate or
description and comments are
appropriate use of poorly described
comments