Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume that the node of a linked list is the usual info-link form with the info

ID: 3646804 • Letter: A

Question

Assume that the node of a linked list is the usual info-link form with the info of type int. (list and ptr are pointers of type nodeType.) The following code creates a linked list.
ptr = new nodeType;
ptr-> info = 16;
list = new nodeType;
list -> info = 25;
list -> link = ptr;
ptr = new nodeType;
ptr -> info = 12;
ptr -> link = NULL;
list -> link -> link = pointer;

Use the linked list created by this code to answer. Declare additional pointers if you need them.
1. Write a C++ code that creates and inserts a node with info 58 before the node with info 25. Does this require you to change the value of the pointer that was pointing to the first node of the linked list?
2. Write a C++ code that deletes the node with info 25. Does this require you to change the value of the pointer that was pointing to the first node of the liked list?

Explanation / Answer

a)node with info=16 points to he first node of the linked list

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote