Question: class 1 public class Link { public int iData; public double dData; public Link next; public Link(int id, double dd) { iData=id; dData=dd; } public

class 1

public class Link { public int iData; public double dData; public Link next; public Link(int id, double dd) { iData=id; dData=dd; }

public void displayLink() { System.out.print("{" +iData +"," + dData +"}"); } }

class 2

public class LinkListApp { public static void main(String[] args) { LinkList theList = new LinkList(); // create list theList.insertFirst(22,2.99); theList.insertFirst(44, 4.99); theList.insertFirst(66,6.99); theList.displayList(); //////////////////////////// Link f= theList.find(44); if(f != null) System.out.println("Found link with key" + f.iData); else System.out.println("Can't find link"); //////////////////// Link d= theList.delete(66); if(d != null) System.out.println("Deleted link with key" + d.iData); else System.out.println("Can't delete link"); /////////////////////// theList.displayList(); }// end main

}//end class

class 3

public class LinkList {

private Link first; //////////////////////////////////////////// public LinkList() //constructor { first= null; } //////////////////////////////////////////// public boolean isEmpty() { return(first==null); } ///***Write here the insertFirst Method ***//

/////** write here the find Method ***///////// ///***Write here the deletFirst Method ***// //////write here the delete Method any position**///// ///***Write here the display Method ***// }

Java program :)

Update the class Link and add different variables such String name, int ID, float GPA

Take the inputs from user to enter data of linkedlist

insertFirst Method ()

deleteFirst Method ()

find Method () // search key taken from user

delete any position Method() // delete specific key taken from user

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!