Question: ncorrect Question 25 #include using namespace std; struct ListNode { string data; ListNode *next; int main() { ListNode *ptr, *list; list = new ListNode; list->data

 ncorrect Question 25 #include using namespace std; struct ListNode { string

ncorrect Question 25 #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; // new code goes here Which of the following code correctly deletes the node with value "Boston" from the it list->next = list: delete list: list = list->next; delete ptr: por list: list = list->next delete pt None of these ptr = list->next; list->next - ptr: delete ptr

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!