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

Use the linked list below for Question A to D. Give the values of the following

ID: 3837282 • Letter: U

Question

Use the linked list below for Question A to D. Give the values of the following expression ptr1- > info ptr2- > next-info listdata- > next- > next- > info Are the following expressions true or false? list data- > next = = ptr1. ptr1- > next - > info = = 60 ptr2- > next = = NULL. list data -> info = = 25 Write one statement to do each of the following Make listdata point to the node containing 45. Make ptr2 point to the last node in the list. Make listdata point to an empty list. Set the info member of the node containing 45 to 60.

Explanation / Answer

1.
A. Give the values of the following expression
1. ptr->info: 30.
2. ptr2->next->info: 90.
3. listdata->next->next->info: 45.

B. Are the following expressions true or false?
1. listdata->next == ptr1.   True.
2. ptr1->next->info == 60. False. It is 45.
3. listdata->info == 25 True.

C. Write one statement to do each of the following.
1. Make listdata point to the node containing 45.
listdata = ptr1->next;   //This will point to node with value 45.
2. Make ptr2 point to the last node in the list.
ptr2 = ptr2->next; //This will point to the last node in the list.
3. Make listdata point to an empty list.
listdata = NULL;   //listdata now point to NULL.
4. Set the info member of the node containing 45 to 60.
ptr1->next->info = 60; //ptr1->next->info is holding 45, and this statement updates its value to 60.

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