Question: XCIO Help Center ? Incorrect Question 24 Consider the following code: #include using namespace std; struct ListNode { string data; ListNode *next; }; int main()

 XCIO Help Center ? Incorrect Question 24 Consider the following code:

XCIO Help Center ? Incorrect Question 24 Consider the following code: #include using namespace std; struct ListNode { string data; ListNode *next; }; int main() { ListNode *ptr, *list; list = new ListNode; list->data = "Boston"; ptr = new ListNode; ptr->data = "New York"; ptr->next = nullptry list->next = new ListNode; list->next->data = "Houston"; list->next->next = ptr; W new code goes here Which of the following code correctly inserts "Chicago" at end of the list when added at point of insertion ptr = new ListNode; ptr->data - "Chicago"; ptr->next = nullptr: ptr ->ned = new ListNode: ptr-data = "Chicago" ptr next-gullt None of these pt new ListNode otr data colage next nullot

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!