Question: Part 1 Java program implement a Single linked list to store student information ( stuID , stuName, stuScore ) . Instance variables Constructor Accessor and
Part
Java program
implement a Single linked list to store student information stuID stuName, stuScore Instance variables Constructor Accessor and Update methods Define a Node Class.a Instance Variableso A stuID generics frameworko B stuName generics frameworko C stuScore generics frameworko Node Next pointer refer to the next node Selfreferentialb Constructorc. Methodso A getStuIDReturn the stuID of this node.o setStuID set the StuID of this node.o A getStuNameReturn the stuName of this node.o setStuNameReturn the stuName of this node.o A getStuScoreReturn the stuScore of this node.o setStuScoreReturn the stuScore of this node.o Node getNextReturn the pointer of this node.o setNextnSet pointer to this node.o displayNodeDisplay information of this node.
Define SLinkedList Classa. Instance Variables:o Node heado Node tailo int sizeb. Constructorc. Methodso int getSizeReturn the number of nodes of the list.o boolean isEmptyReturn true if the list is empty, and false otherwise.o int getFirstStuIDReturn the StuID of first node of the list.o int getLastStuIDReturn the StuID of Last node of the list.o int getFirstStuNameReturn the StuName of first node of the list.o int getLastStuNameReturn the StuName of Last node of the list.o int getFirstStuScoreReturn the StuScore of first node of the list.o int getLastStuScor Return the StuScore of Last node of the list.o Node getHeadReturn the heado setHeadNode hSet the heado Node getTailReturn the tailo setTailNode tSet the tailo addFirstA id B name, C scoreadd new id name, score to the frontof the listo addLastA id B name, C score add new id name, score to the end ofthe listo E removeFirstRemove the first node and return the id of the first nodeof listo displayprint out values of all the nodes of the listo Node searchA idcheck if a given id is in the list, return found nodesor nullo Node updateA key, A id B name, C scoreupdate the id name, scoreof node with a given k to new value, return updated node Define TestSLinkedList Classa. Declare an instance of Single List class.b Test all the methods of Single List class. searche Return one node with values stuID stuName, stuScore which matches agiven key e studentID addAftere stuID, stuName, stuScoreAdd a new node with values stuID stuName,stuScore after the node with the key e studentID removeAteRemove a node which matches a given key e studentID
countReturn a number of nodes of list. updatestuID stuName, stuScoreUpdate the values of one node
Part II:Extension of part II of class lab Implement a Doubly linked list to store student information stuID stuName, stuScore Instance variables Constructor Accessor and Update methods Define a Node Class.a Instance Variableso A stuID generics frameworko B stuName generics frameworko C stuScore generics frameworko Node next pointer refer to the next node Selfreferentialo Node prev pointer refer to the previous node Selfreferentialb Constructorc. Methodso A getStuIDReturn the stuID of this node.o setStuID set the StuID of this node.o A getStuNameReturn the stuName of this node.o setStuNameReturn the stuName of this node.o A getStuScoreReturn the stuScore of this node.o setStuScoreReturn the stuScore of this node.o Node getNextReturn the pointer of this node.o setNextnSet pointer to this node.o setPrevNode nSet previous pointer to this node.o displayNodeDisplay value of this node.o displayNodeDisplay information of this node Define DLinkedList Classa. Instance Variables:o Node headero Node trailero int sizeb. Constructorc. Methodso int getSizeReturn the number of nodes of the list.o boolean isEmptyReturn true if the list is empty, and false otherwise.o int getFirstStuIDReturn the StuID of first node of the list.o int getLastStuIDReturn the StuID of Last node of the list.o int getFirstStuNameReturn the StuName of first node of the list.o int getLastStuNameReturn the StuName of Last node of the list.o int getFirstStuScoreReturn the StuScore of first node of the list.o int getLastStuScor Return the StuScore of Last node of the list.o addBetweenA id B name, C score, Node predecessor, Node successor add a new node between the predecessor and successoro addFirstA id B name, C scoreadd new id name, score to the frontof the listo addLastA id B name, C score add new id name, score to the end ofthe listo addAfterA key, A id B name, C score add new id name, score tolist after a given node with keyido addBeforeA key, A id B name, C score add new id name, score tolist before a given node with keyido Node removeNode noderemove a nodeo Node removeAtA keyremove a node with a give key and return thenodeo E removeFirstRemove the first node and return the node of listo E removeLastRemove the last node and return the node of listo displayprint out values of all the nodes of the listo Node searchA keycheck if a given keyid is in the list, return foundnodes or nullo Node updateA key, A id B name, C scoreupdate the id name, scoreof node with a given k to new value, return updated node Define TestDLinkedList Classa. Declare an instance of Single List class.b Test all the methods of Single List class.Part III: 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 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
