Skip to main content

Posts

Showing posts from July, 2016

Java Example: LinkedList

The purpose of this example is simply get some decent exposure to the LinkedList class. A phone directory is the most desirable choice to show this data structure . Within our phone directory program, we'll want to be able to: add a new record, delete the current record,  change the first name of the current record,  change the last name of the current record,  change the phone number of the current record,  select the current record, show all records and  quit the program. The phone directory will store the first name, last name and the phone number. When inserting, we're going to want to insert the new record into the correct order without creating or using a sorting algorithm . You may have duplicate names but not duplicate phone numbers. The phone directory should be sorted by last name, first name, phone number. When deleting a record, there will not be a current record that's selected. To select the record after deletion, you must use the select the curre