Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1. (10 marks) A professor is taking two courses in this semester. Some students are enrolled in one of his courses while some are enrolled
Q1. (10 marks) A professor is taking two courses in this semester. Some students are enrolled in one of his courses while some are enrolled in both. To maintain the data of his students, he creates a program using linked lists. He maintains a list for each course containing the names of the students enrolled in that course. Now he wants to check which students are attending both of his courses. Considering the given ADTs, use only the attributes and member functions outlined to create a non-member C++ function Node* common(Node *headl, Node *head2) that takes the two lists (i.e. coursel and course2) as argument and returns a single list Node Class ADT Linked List Class ADT class Node class List { public: public: string name; Node *head; Node *next; List(); }; bool isEmpty(); void insert_beg(string); void insert_end (string); void traverse(); }; of students common in both courses.[10] NOTE : You have freedom to use any logics using material studied in this course only
Step 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