This is what we have to do: 1) Define a class LinkedList and make 2 linked lists.
Question:
This is what we have to do:
1) Define a class LinkedList and make 2 linked lists.
2) Then, combine the list 1 and list 2 to make a third linked list. So, list 1 + list 2 = list 3. To do this, we have to overload the '+' operator by doing operator+() to add list1 and list2. Then we have to overload the '=' operator by doing operator=() to set result of list1+list2 equal to list 3.
3) Each item in the linked list will contain a 4 digit ID number made of random integers and a string for a name. Each item of the linked list should also contain the next-?pointer to the next item.
4) From this point on, every operation will be performed on list 3.
5) The operations we have to do is "Add item to the list", "Remove item from the list", "print the entire list", "print one element of the list", and "sort the list according to ID number".
6) To print one element of the list, we will need overload the operator[] ?to print one element of the list using index as shown. Also we need to overload the ostream operator << ?to display the output by cout << list3[index] << endl?
Could someone please help me do this? I do not understand linked list at all. Your help will be much appreciated!
This is a sample output:
Sample output of operations:
Managerial Accounting for the Hospitality Industry
ISBN: 978-1119386223
2nd edition
Authors: Lea R. Dopson, David K. Hayes