Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Nodeint 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. marks b Write the pseudocode of the function INSERTheadx 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 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. marks c Write the pseudocode of the function SEARCHheadx that returns TRUE if the number x is in the data structure in any of the secondary lists and FALSE otherwise. marks d Write the pseudocode of the function DELETEhead b that receives as input arguments the head of the last of two lists and a Boolean value. The function DELETEheadb deletes one of the main nodes. If b equals then the node storing number is deleted. Otherwise, the main node storing number is deleted. Consider the following cases: the main list is empty and it has only one node node or
Help me solve the question using the image provided please show me all the code and pseudocode. Thank u
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started