Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the code given to you for this project, you can notice in the main function that you will be creating two lists (called firstintegerList
In the code given to you for this project, you can notice in the main function that you will be creating two lists (called firstintegerList and secondIntegerList) of the same size (listSize) and whose values are in the range [1..max Value]. Add a member function mergeList to the Singly Linked List-based implementation of the List ADT. The member function takes as input a List object (representing the second integer list) as parameter and appends it to the List object (representing the first integer list) on which the function will lled. You should append only those elements (from the second integer list) that are not already in first integer list. Feel free to create additional member functions to facilitate this For example: if the firstIntegerList is 112244- 557889 and the secondIntegerList is 22 --> 56--> 89--> 77--> 32 55, then the contents of the first!ntegerList (after the merger) should be 11-22--4455-7889-56-77 -32 The main function has the timers setup to merge the two lists and print the merging time in milliseconds. You should run the code for the following combinations of values for the two variables and tabulate the results max Value: 1000, 10000, 100000 listSize: 1000, 10000, 100000 ar charts (in Excel) of the logarithm values of the run time (since the run time values will be of different ranges for the above combinations of values, we will take the natural logarithm, to the base e, irn Excel and use these values to plot) as follows (1) max Value in X-axis and the listSize in Y-axis (2) listSize in X-axis and the max Value in Y-axis Submission (in Canvas): Submit a singly report that has the following (a - 20 pts) Explain the logic/algorithm that you incorporated to your code to accomplish the merger of only unique elements: i.e., to merge an element (from the secondIntegerList) to the firstIntegerList only if the element is not already in the latter. Provide a pseudo code for the entire merge list function (including the logic for merger of unique elements) and analyze its time complexity as a function of the list size, n. (b - 45 pts) Include the complete C++ code comprising of the Node class, List class with all the added member functions and the main function. and listSize given. of the milliseconds observed) (c 11 pts) Tabulate the actual values of the run time (in milliseconds) for the combinations of max Value (d - 12 pts) Present Excel bar charts (using the two ways prescribed) for the run time (plotted in logarithm (e 12 pts) From the bar charts, infer whether (on a relative basis) there is a significant increase in the run time with increase in listSize (for a given max Value) or there is a significant increase in the run time with increase in max Value (for a given listSize)? In the code given to you for this project, you can notice in the main function that you will be creating two lists (called firstintegerList and secondIntegerList) of the same size (listSize) and whose values are in the range [1..max Value]. Add a member function mergeList to the Singly Linked List-based implementation of the List ADT. The member function takes as input a List object (representing the second integer list) as parameter and appends it to the List object (representing the first integer list) on which the function will lled. You should append only those elements (from the second integer list) that are not already in first integer list. Feel free to create additional member functions to facilitate this For example: if the firstIntegerList is 112244- 557889 and the secondIntegerList is 22 --> 56--> 89--> 77--> 32 55, then the contents of the first!ntegerList (after the merger) should be 11-22--4455-7889-56-77 -32 The main function has the timers setup to merge the two lists and print the merging time in milliseconds. You should run the code for the following combinations of values for the two variables and tabulate the results max Value: 1000, 10000, 100000 listSize: 1000, 10000, 100000 ar charts (in Excel) of the logarithm values of the run time (since the run time values will be of different ranges for the above combinations of values, we will take the natural logarithm, to the base e, irn Excel and use these values to plot) as follows (1) max Value in X-axis and the listSize in Y-axis (2) listSize in X-axis and the max Value in Y-axis Submission (in Canvas): Submit a singly report that has the following (a - 20 pts) Explain the logic/algorithm that you incorporated to your code to accomplish the merger of only unique elements: i.e., to merge an element (from the secondIntegerList) to the firstIntegerList only if the element is not already in the latter. Provide a pseudo code for the entire merge list function (including the logic for merger of unique elements) and analyze its time complexity as a function of the list size, n. (b - 45 pts) Include the complete C++ code comprising of the Node class, List class with all the added member functions and the main function. and listSize given. of the milliseconds observed) (c 11 pts) Tabulate the actual values of the run time (in milliseconds) for the combinations of max Value (d - 12 pts) Present Excel bar charts (using the two ways prescribed) for the run time (plotted in logarithm (e 12 pts) From the bar charts, infer whether (on a relative basis) there is a significant increase in the run time with increase in listSize (for a given max Value) or there is a significant increase in the run time with increase in max Value (for a given listSize)
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