Question: In a single linked list implemented in Java, this is the definition of a node: class Node { int data; Node nextNode; / / Constructor

In a single linked list implemented in Java, this is the definition of a node: class Node { int data; Node nextNode; // Constructor to create a new node // nextNode is by default initialized as null Node(int d){ data = d; }} a) Assuming that the above definition is kept for the nodes of the secondary lists, device a new definition of node for the nodes of the main list. Call this type of node MainNode and use the names of pointers NextNode and NextList respectively in your implementation. (5.0 marks) b) Write the pseudocode of the function INSERT(head,x) that inserts a new number in this data structure. If the number is even it must go to the second secondary list, the list that starts with node 1 in the main list. Otherwise, it must go to the first secondary list. Assume the data structure already has the main list created and numbers are inserted at the start of the secondary list. (5.0 marks) c) Write the pseudocode of the function SEARCH(head,x) that returns TRUE if the number x is in the data structure (in any of the secondary lists) and FALSE otherwise. (5.0 marks) d) Write the pseudocode of the function DELETE(head, b) that receives as input arguments the head of the last of two lists and a Boolean value. The function DELETE(head,b) deletes one of the main nodes. If b equals 0, then the node storing number 0 is deleted. Otherwise, the main node storing number 1 is deleted. Consider the following cases: the main list is empty and it has only one node (node 0 or 1).
Help me solve the question using the image provided please show me all the code and pseudocode. Thank u
 In a single linked list implemented in Java, this is the

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!