Question: Use C++ 2. (5 points) Implement the sort member function with prototype void sort (bool flag) for the SList class (done in lab 9.2), which
Use C++


2. (5 points) Implement the sort member function with prototype void sort (bool flag) for the SList class (done in lab 9.2), which sorts the list in ascending order if the flag is 1 otherwise in the descending order. class Node int data; Node *next; public: Node() {data = 0; next = 0;} void setData(int d) Idata -d;h void setNext (Node *n) {next = n;} int getData)freturn data;J
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
