Question: Design and implement a program using linked lists (using Java Collections) to create, manage, and retrieve information on a self-reorganizing list of names and telephone

Design and implement a program using linked lists (using Java Collections) to create, manage, and retrieve information on a self-reorganizing list of names and telephone numbers. When a node is created its ct is set to zero and it is placed at the first of the list. Every time a node is referenced, its ct is increased by 1 and when ct reaches 3 (a magic number?) the node should be deleted from its current place on the list, replaced at the head of the list, and its ct reset to 0. The program should recognize three commands, requested by the prompt CMD: A Add a phone number. The program prompts for a name, and a telephone number. L Look up a number. The program prompts the user to input a name. C Change a phone number. The program prompts with name and a new phone number, printing an error message if the name does not exist in the list. S Save the list to a file, as described below. The program should initialize itself from a text file of names and phone numbers (which contains a list of names and phone numbers that may initially be empty). When the command S is entered, the program should rewrite the file with the current form of the list. Also perform the following analysis: what is the order of magnitude to perform each operation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!