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
ziro4ka [17]
3 years ago
13

Suppose we are comparing the implementations of insertion sort and merge sort on the same machine(You don’t need to know the alg

orithm to do this problem!). For inputs of size n, insertion sort runs in 8n^2, while merge sort runs in 64nlgn steps. For which values of n does insertion sort beat merge sort?
Computers and Technology
1 answer:
Anuta_ua [19.1K]3 years ago
4 0

Answer:

123456789o0

Explanation:

You might be interested in
One of the greatest benefits of dual enrollment courses is that students can receive:
Vika [28.1K]
I think the answer to this is A
7 0
3 years ago
Read 2 more answers
Half of the integers stored in the array data are positive, and half are negative. Determine the
jonny [76]

Answer:

Check the explanation

Explanation:

Below is the approx assembly code for above `for loop` :-

1). mov ecx, 0

2). loop_start :

3).    cmp ecx, ARRAY_LENGTH

4).    jge loop_end

5).    mv temp_a, array[ecx]

6).    cmp temp_a, 0

7).    branch on nge

8).        mv array[ecx], temp_a*2

9).   add ecx, 1

10).   jmp loop_start

11). loop_end :

Assumptions :-

*ARRAY_LENGTH is register with value 1000000

*temp_a is a register

Frequency of statements :-

1) will be executed one time

3) will be executed 1000000 times

4) will be executed 1000000 times

5) will be executed 1000000 times

6) will be executed 1000000 times

7) `nge` will be executed 1000000 times, branch will be executed 500000 times

8) will be executed 500000 times

9) will be executed 1000000 times

10) will be executed 1000000 times

Cost of statements :-

1) 10 ns

3) 10ns + 10ns + 10ns [for two register accesses and one cmp]

4) 10ns [for jge ]

5) 10ns + 100ns + 10ns [10ns for register access `ecx`, 100ns for memory access `array[ecx]`, 10ns for mv]

6) 10ns + 10ns [10ns for register_access `temp_a`, 10ns for mv]

7) 10ns for nge, 10ns for branch

8) 30ns + 110ns + 10ns

10ns + 10ns + 10ns for temp_a*2 [10ns for moving 2 into a register, 10ns for multiplication],

110ns for array[ecx],

10ns for mv

9) 10ns for add, 10ns for `ecx` register access

10) 10ns for jmp

Total time taken = sum of (frequency x cost) of all the statements

1) 10*1

3) 30 * 1000000

4) 10 * 1000000

5) 120 * 1000000

6) 20 * 1000000

7) (10 * 500000) + (10 * 1000000)

8) 150 * 500000

9) 20 * 1000000

10) 10 * 1000000

Sum up all the above costs, you will get the answer.

It will equate to 0.175 seconds

7 0
3 years ago
FIRST PERSON TO FINISH GETS BRAINLIST
ivanzaharov [21]
1. D

2. D

3. ?

4. False

5. True

3 0
3 years ago
What are important requirements for a frame of reference to identify an object's location, and to communicate that location to a
gogolik [260]

Answer:  Set a scale, or method of determining distance, within your system. Identify an origin near an object—specifically something fixed.

Explanation:

4 0
3 years ago
I am a receptionist for a large corporation what career cluster is this in?
RSB [31]
Business and administration
4 0
3 years ago
Read 2 more answers
Other questions:
  • The means by which you interact with any program on a computer is called the ____. Answer
    5·1 answer
  • From the standpoint of the governing bodies of .com, why is it important that owners of individual domains maintain authoritativ
    5·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    7·1 answer
  • The answer is family and friends
    8·2 answers
  • Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
    5·1 answer
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • Putting commands in correct order so computers can read the commands
    9·1 answer
  • Which file is usually the first file to be displayed when you navigate to a website?
    5·1 answer
  • State the functions of the parts of the computer​
    11·2 answers
  • Which of the following describe the characteristics of a good logo? Choose all that apply. It is a complex design It is memorabl
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!