Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please explain the code, don't just write the answer.. thank you ! A strictly increasing list is a list each of whose elements has a
please explain the code, don't just write the answer.. thank you !
A strictly increasing list is a list each of whose elements has a value that is less than the one that follows it. For example, 3 7 8 10 is a strictly increasing list, but 3 8 7 10 is not (8 is not less than 7), and 3 7 7 10 is not (7 is not less than 7). If x and y are Linked Lists whose nodes form two strictly increasing lists, calling x.writeDiff (y) writes out, one per line, all elements of x that are not in y. For example, if x contains 2 3 5 8 9 and y contains 3 5 6 7 8 10, then x.writeDiff (y) would write, one per line, the values 2 and 9. The member function writeDiff calls a helper function wd, which accepts two Node pointers; if each points to a (possibly empty) strictly increasing linked list of Nodes, it writes out the values, one per line, that are in the first list but not the second. In the space below, write a recursive implementation of the wd member function. You should assume that each of the lists is a (possibly empty) strictly increasing list. You will receive a score of zero on this problem if the body of your wd member function is more than 20 statements long or if it contains any occurrence of the keywords while, for, or goto. void Linkedlist::wd (const Node* pi, const Node* p2) constStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started