Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 10 In this assignment, we will work with linked list and operator overloading. Define a class LinkedList and making 2 linked lists. Combine the
Assignment 10 In this assignment, we will work with linked list and operator overloading. Define a class LinkedList and making 2 linked lists. Combine the two linked list to make the third linked list. For each node of the linked list, it will contain 2 data type, a string for student name, and a four-digit integer for the RUID (random number). Each node of linked list should also contain the next-pointer to the next node. Overloading the adding operator (+) and the assignment operator () to combine the linked list. For example, the lists are defined using LinkedList class as follow, LinkedList list1, list2, list3; // populate list1 and list2 by adding nodes to the lists list3 list1+ list2; // overloading the adding operator +)to perform this operation Note: we would need to overload the assignment operator () to set the result of (list1+list2) to ist 3 After adding the two list, select the next operation to perform on the resulted linked list only (list3). The operations are adding node to the list, removing node from the list, print the entire list, print one element of the list, sort the list according to RUID number. To print one element of the list, we will need overload the operatorl to print one element of the list using index as shown. You would also need to overload the ostream operator
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