Question: I need help with these questions please help! (20 pts) Consider a doubly linked list of items that are in no particular order. Assume the

I need help with these questions please help!

 I need help with these questions please help! (20 pts) Consider

a doubly linked list of items that are in no particular order.

Assume the doubly linked list has only a head reference. You are

(20 pts) Consider a doubly linked list of items that are in no particular order. Assume the doubly linked list has only a head reference. You are allowed to use only one temporary curr reference without the need of others such as prev. a. Write instructions to insert a node referenced by newNode at the beginning of the linked list. b. Write instructions to delete a node referenced by newNode at the beginning of the linked list. c. Write instructions to insert a node referenced by newNode at the end of the linked list. d. Write instructions to delete a node referenced by newNode at the end of the linked list. Similar to Problem 1, you should consider special cases. (10 pts) Consider a linked list of items that are in no particular order. Assume the linked list has a head reference and a tail reference. a. Write instructions to insert a node referenced by newNode at the end of the linked list. You shouldn't use a loop. b. Write instructions to delete a node referenced by newNode at the end of the linked list. Note that the first step to solve this problem is to identify all possible cases, including inserting into an empty linked list, deleting from a linked list with zero or one node, and so on. Drawing pictures helps. class Node { int value; Node next; // constructors } 4. (5 pts) Implement the method int number Positive(Node head) that counts the number of positive integers in a linked list of integers iteratively. Assume the linked list is reference by head. 5. (5 pts) Implement the method Node search (Node head, int key) that returns the reference to the node with the value key in a linked list of distinct integers iteratively. Assume the linked list is reference by head. The method returns null if the search fails

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!