Question: Part 1 Java program implement a Single linked list to store student information ( stuID , stuName, stuScore ) . Instance variables Constructor Accessor and

Part 1
Java program
implement a Single linked list to store student information (stuID, stuName, stuScore). Instance variables Constructor Accessor and Update methods1. Define a Node Class.a. Instance Variableso A stuID -(generics framework)o B stuName -(generics framework)o C stuScore -(generics framework)o Node Next (pointer)- refer to the next node (Self-referential)b. Constructorc. Methodso A getStuID()//Return the stuID of this node.o setStuID ()//set the StuID of this node.o A getStuName()//Return the stuName of this node.o setStuName()//Return the stuName of this node.o A getStuScore()//Return the stuScore of this node.o setStuScore()//Return the stuScore of this node.o Node getNext()//Return the pointer of this node.o setNext(n)//Set pointer to this node.o displayNode()//Display information of this node.
2. Define SLinkedList Classa. Instance Variables:o Node heado Node tailo int sizeb. Constructorc. Methodso int getSize()//Return the number of nodes of the list.o boolean isEmpty()//Return true if the list is empty, and false otherwise.o int getFirstStuID()//Return the StuID of first node of the list.o int getLastStuID()//Return the StuID of Last node of the list.o int getFirstStuName()//Return the StuName of first node of the list.o int getLastStuName()//Return the StuName of Last node of the list.o int getFirstStuScore()//Return the StuScore of first node of the list.o int getLastStuScor ()//Return the StuScore of Last node of the list.o Node getHead()//Return the heado setHead(Node h)//Set the heado Node getTail()//Return the tailo setTail(Node t)//Set the tailo addFirst(A id, B name, C score)//add new id, name, score to the frontof the listo addLast(A id, B name, C score)// add new id, name, score to the end ofthe listo E removeFirst()//Remove the first node and return the id of the first nodeof listo display()//print out values of all the nodes of the listo Node search(A id)//check if a given id is in the list, return found nodesor nullo Node update(A key, A id, B name, C score)//update the id, name, scoreof node with a given k to new value, return updated node3. Define TestSLinkedList Classa. Declare an instance of Single List class.b. Test all the methods of Single List class. search(e)// Return one node with 3 values (stuID, stuName, stuScore) which matches agiven key e (studentID). addAfter(e, stuID, stuName, stuScore)//Add a new node with 3 values (stuID, stuName,stuScore) after the node with the key e (studentID). removeAt(e)//Remove a node which matches a given key e (studentID)
count()//Return a number of nodes of list. update(stuID, stuName, stuScore)//Update the values of one node
Part II:Extension of part II of class lab 5 Implement a Doubly linked list to store student information (stuID, stuName, stuScore). Instance variables Constructor Accessor and Update methods1. Define a Node Class.a. Instance Variableso A stuID -(generics framework)o B stuName -(generics framework)o C stuScore -(generics framework)o Node next (pointer)- refer to the next node (Self-referential)o Node prev (pointer)- refer to the previous node (Self-referential)b. Constructorc. Methodso A getStuID()//Return the stuID of this node.o setStuID ()//set the StuID of this node.o A getStuName()//Return the stuName of this node.o setStuName()//Return the stuName of this node.o A getStuScore()//Return the stuScore of this node.o setStuScore()//Return the stuScore of this node.o Node getNext()//Return the pointer of this node.o setNext(n)//Set pointer to this node.o setPrev(Node n)//Set previous pointer to this node.o displayNode()//Display value of this node.o displayNode()//Display information of this node.2. Define DLinkedList Classa. Instance Variables:o Node headero Node trailero int sizeb. Constructorc. Methodso int getSize()//Return the number of nodes of the list.o boolean isEmpty()//Return true if the list is empty, and false otherwise.o int getFirstStuID()//Return the StuID of first node of the list.o int getLastStuID()//Return the StuID of Last node of the list.o int getFirstStuName()//Return the StuName of first node of the list.o int getLastStuName()//Return the StuName of Last node of the list.o int getFirstStuScore()//Return the StuScore of first node of the list.o int getLastStuScor ()//Return the StuScore of Last node of the list.o addBetween(A id, B name, C score, Node predecessor, Node successor)// add a new node between the predecessor and successoro addFirst(A id, B name, C score)//add new id, name, score to the frontof the listo addLast(A id, B name, C score)// add new id, name, score to the end ofthe listo addAfter(A key, A id, B name, C score)// add new id, name, score tolist after a given node with key(id)o addBefore(A key, A id, B name, C score)// add new id, name, score tolist before a given node with key(id)o Node remove(Node node)//remove a nodeo Node removeAt(A key)//remove a node with a give key and return thenodeo E removeFirst()//Remove the first node and return the node of listo E removeLast()//Remove the last node and return the node of listo display()//print out values of all the nodes of the listo Node search(A key)//check if a given key(id) is in the list, return foundnodes or nullo Node update(A key, A id, B name, C score)//update the id, name, scoreof node with a given k to new value, return updated node3. Define TestDLinkedList Classa. Declare an instance of Single List class.b. Test all the methods of Single List class.Part III:1. Implement an algorithm for concatenating two singly linked list L and M, into a singlelist N that contains all the nodes of L followed by all then nodes of M.2. Implement an algorithm for concatenating two doubly linked list L and M, into a singlelist N that contains all the nodes of L followed by all then nodes of M.

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!