1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
otez555 [7]
3 years ago
11

Merge sort has a o(n log2(n)) complexity. if a computer can sort 1,024 elements in an amount of time x, approximately how long w

ill it take the computer to sort 1,024 times that many, or 1,048,576 elements?
Computers and Technology
1 answer:
Musya8 [376]3 years ago
6 0
<span>1,048,576 is 1,024 times 1,024, 1,024 * 1,024 or 1,024 squared or 1,024^2. If a computer takes x amount of time to sort 1,024 elements then the relationship is a 1 to 1. Therefore the computer will take x times x or x^2 (x squared) amount of time to sort 1,048,576.</span>
You might be interested in
Choose the answer.
Alik [6]
A home network aswell business networking would use a Router to connect the lam and internet all together
3 0
2 years ago
Read 2 more answers
Which is the best method of marketing a game to casual players?
Phoenix [80]
A casual game is a video game targeted at or used by casual gamers. Casual games may exhibit any type of gameplay or genre. They are typically distinguished by simple rules and by reduced demands on time and learned skill, in contrast to more complex hardcore games. They typically impose low production and distribution costs on the producer. Casual games are often played on a personal computer online in web browsers, but are also popular on game consoles and mobile phones.

Hope this helped. Have a great day! :D
3 0
3 years ago
Read 2 more answers
It is possible to play older console games such as those written for the nintendo game boy or sega genesis on a personal compute
timurjin [86]
Emulator««««that is the answer
5 0
3 years ago
Materials such as copper, silver, and aluminum through which electric energy passes freely are called
nasty-shy [4]
These materials are called conductors
6 0
3 years ago
g Write a program that prompts the user for an integer n between 1 and 100. If the number is outside the range, it prints an err
grin007 [14]

Answer:

The cpp program is given below.

#include<iostream>

#include<iomanip>

using namespace std;

int main() {

   

   // variables declared

   int n;

   int sum=0;

   float avg;

   

   do

   {

       // user input taken for number    

       cout<< "Enter a number between 1 and 100 (inclusive): ";

       cin>>n;

       

       if(n<1 || n>100)

           cout<<" Number is out of range. Enter valid number."<<endl;

       

   }while(n<1 || n>100);

   

   cout<<" "<<endl;

   

   // printing even numbers between num and 50  

   for(int num=1; num<=n; num++)

   {

       sum = sum + num;

   }

   

   avg = sum/n;

   

   // displaying sum and average

   cout<<"Sum of numbers between 1 and "<<n<<" is "<<sum<<endl;

   cout<<"Average of numbers between 1 and "<<n<<" is ";

   printf("%.2f", avg);

   

       return 0;

}

OUTPUT

Enter a number between 1 and 100 (inclusive): 123

Number is out of range. Enter valid number.

Enter a number between 1 and 100 (inclusive): 56

 

Sum of numbers between 1 and 56 is 1596

Average of numbers between 1 and 56 is 28.00

Explanation:

The program is explained below.

1. Two integer variables are declared to hold the number, n, and to hold the sum of numbers from 1 to n, sum. The variable sum is initialized to 0.

2. One float variable, avg, is declared to hold average of numbers from 1 to n.

3. User input is taken for n inside do-while loop. The loop executes till user enters value between 1 and 100. Otherwise, error message is printed.

4. The for loop executes over variable num, which runs from 1 to user-entered value of n.

5. Inside for loop, all the values of num are added to sum.

sum = sum + num;

6. Outside for loop, average is computed and stored in avg.

avg = sum/n;

7. The average is printed with two numbers after decimal using the following code.

printf("%.2f", avg);

8. The program ends with return statement.

9. All the code is written inside main() and no classes are involved.

3 0
3 years ago
Other questions:
  • WHAT IS SQL AND HOW CAN YOU MEET THE DATA REQUIREMENTS ALSO MAINTAINING DATA INTEGRITY,AND LASTLY STATE THE FULL MEANING OF SQL
    11·1 answer
  • Which of the following mountain ranges stretches from Alabama to Canada?
    10·1 answer
  • Computers are not just stand-alone desktop machines anymore. They are often embedded in common appliances and technology that we
    6·1 answer
  • The while loop has two important parts: a condition that is tested and a statement or block of statements that is repeated as lo
    8·1 answer
  • Suppose that your application uses a loop that isn't producing the intended results. The best way to analyze what’s going on in
    13·1 answer
  • Technician A says that temperature sensors decrease in resistance as the temperature​ increases; this is called positive tempera
    12·1 answer
  • Why are computers complicated?
    15·1 answer
  • How do I get the most points, without any effort?
    11·2 answers
  • Domestic refers to things that happen __________ of the united states
    15·2 answers
  • What is the main difference between a peripheral device and other types of devices? Choose the best answer.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!