Question: Using Linked list approach, read the files and (add or delete specified records using linked list) and output the updated list to p3artists.txt file: Introduction:

Using Linked list approach, read the files and (add or delete specified records using linked list) and output the updated list to "p3artists.txt" file:

Introduction:

We continue with the Bag data structure. However, in this project we focus on the representation of the Bag structure using singular linked list as described in chapter 3 of your textbook. Please study the sample programs LinkedBag.java and LinkedBagDemo.java.

Part A.

Data Files: p1artists.txt and p2changes.txt.

Assignment:

1) Use the Linked approach to update p1artists.txt through p2changes.txt to produce p3artists.txt.

If A : Add record using linked list

If D : Delete record using linked list

2) Use System.nanoTime() to find the time spent on this approach

Artist.java:

public class Artist { private int artistID; //id of artist private String artistName; //name of artist Artist(int number, String name) { this.artistID = number; this.artistName = name; }

//return the artistName public String getArtistName() { return artistName; }

//set the artistName public void setArtistName(String artistName) { this.artistName = artistName; }

//return the artistId public int getArtistID() { return artistID; }

// set the artistId public void setArtistID(int artistId) { this.artistID = artistId; }

// toString method public String toString() { return this.artistID + "\t" + this.artistName; }

}

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!