Answer:
linkedListOperations = linkedListLibrary.InsertSorted(currNode, linkedListOperations); // this is right
linkedListLibrary.InsertSorted(currNode, linkedListOperations); // half right, it count how much operation but it doesn't store it anywhere in main.
vectorOperations = vectorLibrary.InsertSorted(tempBook, vectorOperations); // this is right
vectorLibrary.InsertSorted(tempBook, vectorOperations); // half right, it count how much operation but it doesn't store it anywhere in main.
cout << "Number of linked list operations: " << linkedListOperations << endl;
cout << "Number of vector operations: " << vectorOperations << endl;
Step-by-step explanation:
The first, you are calling InsertSorted with linkedListLibrary and than you can store the number of operation inside the "linkedListOperations" variable. Then you do the same with vectorLibrary.