Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An online game collects data about each player s performance in the game. A program is used to analyze the data to make predictions about

An online game collects data about each players performance in the game. A program is used to analyze the data to make predictions about how players will perform in a new version of the game. The procedure GetPrediction (idNum) returns a predicted score for the player with ID number idNum. Assume that all predicted scores are positive. The GetPrediction procedure takes approximately 1 minute to return a result. All other operations happen nearly instantaneously. Two versions of the program are shown below. Version I topScore 0 idList [1298702,1356846,8848491,8675309] FOR EACH id IN idList { score GetPrediction (id) IF (score > topScore){ topScore score }} DISPLAY (topScore) Version II idList [1298702,1356846,8848491,8675309] topID idList[1] FOR EACH id IN idList { IF (GetPrediction (id)> GetPrediction (topID)){ topID id }} DISPLAY (GetPrediction (topID)) Which of the following best compares the execution times of the two versions of the program? (A) Version I requires approximately 1 more minute to execute than version II.(B) Version I requires approximately 5 more minutes to execute than version II.(C) Version II requires approximately 1 more minute to execute than version I. (D) Version II requires approximately 5 more minutes to execute than version I.

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions