Question: Suppose that the following is the node definition for single linked list: struct node ( int ID ; node* next; }; typedef node* link; and
Suppose that the following is the node definition for single linked list: struct node (
int ID ;
node* next;
};
typedef node* link;
and
class LL {
...
link first;
}
LL S1;
LL S2;
Assume that S1 has 25 ordered items between 1 and 100, Develop a function that takes parameters S1, S2, and and partition S1 into two Linked Lists in such a way that S1 has all items less than K, S2 has all items that are equal or greater than K
Step by Step Solution
There are 3 Steps involved in it
include using namespace std struct Node int data Node next only for the 1st Node void initNodestruct Node headint n headdata n headnext NULL apending void addNodestruct Node head int n Node newNode ne... View full answer
Get step-by-step solutions from verified subject matter experts
