Question: * * The lab exercise is almost identical as Assignment 6 . You don't have to complete it , just submit what you have before

** The lab exercise is almost identical as Assignment 6. You don't have to complete it, just submit what you have before the deadline about either options below.
Assignment 5's runtime was too slow -- a couple of minutes or so. It's because of the duplicate-checking, with over 3.5 billion compares.
Rewrite the duplicate-checking logic from Assignment 5, using a technique from "Techniques For Big Data, Reading" to do fewer compares.
Doing Fewer Compares: Using an array of objects including an array: How to declare the 2-D array for the two options below?
Option 1: (Static Array contains Dynamic Arrays)
There are less than 100 terms (3 terms (each year)*20 years)
Average 1500 sections in each term (60**1500=90k)
If so, average comparison will become 30+750=780(comparisons)
800 vs 40,000, it is much LESS!!
64M vs 3200M comparison; 6 sec vs 5min
Option 2: (Static Array contains Static Arrays)
There are 9999 section numbers, let's create one size of 10,000 array to contain another array of term.
By using the section number as the index of the array, we can directly find the corresponding term array to see if it is a duplicated section
How many comparisons we need? Maybe just one...
The fastest runtime, but waste lots of memory space.
There are most 1500 sections in a term, but create 10k-size array. Only 15% indexes with valid data.
The default stack memory may need to enlarge than 1MB
Discuss and work with your peer to choose one of the options above to bring down the runtime of the duplicate check from Assignment 5.
Refer to the flowchart using option 1 and complete the "term-check" and "section-check" blocks
Submit the source file (LabExercise6.cpp) and the screenshot of sample output.
 ** The lab exercise is almost identical as Assignment 6. You

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!