Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

10th Edition

0137916787, 978-0137916788

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago