{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

List.cpp - List.cpp This program implements the mergeLists...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * List.cpp - This program implements the mergeLists() helper function. * * Dr. Jack Davault * CS3330 Data Structures and Algorithms */ #include <iostream> #include <cstdio> #include <list> using namespace std; template <class Object> void printList(list<Object> list1); template <class Object> void mergeLists(list<Object>& merged, list<Object>& L1, list<Object>& L2); int main(int argc, char **argv) { // Declare list variables list<double> L1; list<double> L2; list<double> L3; list<double> merged; // Add data to the list L1 L1.push_back(80.5); L1.push_back(20.4); L1.push_back(53.8); L1.push_back(52.4); L1.push_back(81.7); // Print the contents of the list cout << "List (L1): " << endl; printList(L1); // Add data to the list L2 L2.push_back(45.2); L2.push_back(80.1); L2.push_back(87.6); L2.push_back(16.1); L2.push_back(25.6); // Print the contents of the list cout << "List (L2): " << endl; printList(L2); // Add data to the list L3 L3.push_back(61.1); L3.push_back(56.2); L3.push_back(69.8); L3.push_back(73.7); L3.push_back(51.9); // Print the contents of the list cout << "List (L3): " << endl; printList(L3);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}