Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Strategy efficiency (4 points) Two versions of a strategy to solve the 10 largest trades on a given day in the NYSE problem are

image text in transcribed

4. Strategy efficiency (4 points) Two versions of a strategy to solve the 10 largest trades on a given day in the NYSE" problem are given below: Strategy a: Updating an unsorted output array: a.1. Let B be an array of size 10. a.2. Copy the first 10 trade values from A into B. a.3. Scan B to locate the smallest trade value Lin it. a.4. Repeat steps a.4.1-a.4.3for each of the remaining (10 million-ten) trade values in A: a.4.1 Get the next trade value from A and compare it with L. a.4.2 If L is larger or equal, do nothing a.4.3 Otherwise a.4.3.1 Replace Lin B with this next trade value from A. a.4.3 2 Scan B to locate the smallest trade value Lin it. a.5 Output the trade values in B. The second version maintains B in a sorted state so that the largest trade value in it could be directly located: Strategy a': Updating a sorted output array: a'.1. Let B be an array of size 10. a'.2. Copy the first 10 trade values from A into B. a'.3. sort B in ascending or descending order a'.4. Repeat steps 3b.4.1-3b.4.2for each of the remaining (10 million-ten) trade values in A: a'.4.1 Get the next trade value from A and compare it with the smallest value in B a'.4.2 if the smallest value in B is larger or equal, do nothing a'.4.3 Otherwise a'.4.3.1 Replace the smallest value in B with this next trade value from A. a'.4.3 2 sort B in the same order a'.4. Output the trade values in B. both are equally efficient Which version is more efficient? Circle one: Strategy a Strategy a' Provide a technical justification or argument (short and precise) to support your claim

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

Students also viewed these Databases questions

Question

Are my points each supported by at least two subpoints?

Answered: 1 week ago