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
Bogdan [553]
4 years ago
8

Given the following Python function, find out an asymptotically tight bound of the algorithm in term of n (the input parameter).

This function returns a list of n integers. Each element in the list contains the value f(i) = i + ⌊ i 2 ⁄ ⌋ + ⌊ i 4 ⁄ ⌋ + ⋯ 1. Write your answer as Python comments in the file csc220a2.py
Computers and Technology
1 answer:
alexandr1967 [171]4 years ago
6 0

Answer:

Explanation:

There are two loops in the given code snippet:

1. Both the loops are nested

2. The outer loop which is for loop is running n number of times linearly.

3. The inner loop which is while loop is jumping in the power of 2, which makes it run log n number of times.

So the overall complexity of the code will be= n * log n

Time complexity(or upper bound)= O(n log n).

Hit the thumbs up if you liked the answer. :)

You might be interested in
The ________ view in access looks similar to an excel spreadsheet.
ch4aika [34]
Datasheet 
<span>The datasheet view in access looks similar to an excel spreadsheet.</span>
6 0
3 years ago
While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar
sergejj [24]
When in slide show mode, the menu bar and that "x" are not visible.
5 0
3 years ago
Read 2 more answers
A type of malicious code that appears to be a safe program but that actually has a hidden purpose is called a _____.
masha68 [24]

This is a trojan horse type of virus.

5 0
3 years ago
Read 2 more answers
Which software is used to play, create, and modify audio and video files?
igor_vitrenko [27]
Video Editing software is used to play, create, and modify audio and video files. 
7 0
3 years ago
Read 2 more answers
John works as a sales representative with Northwind Traders. He has to make a presentation to his customers in another town. The
Sphinxa [80]

Answer:

Laptop.

Explanation:

In the following scenario, John works in the company as the sales representative and he creates a presentation for his users who belongs to another town. The following presentation contains 10GB storage and he also modifying his presentation at the time of traveling.

So, It is clear that he is not using the Mainframe, PDA, or any other desktop computer, he will using his Laptop.

8 0
3 years ago
Other questions:
  • What is requirement analysis
    8·1 answer
  • You just brought a new hard drive for your computer. U plan to use this as a secondary hard drive to store all your uma files. O
    10·1 answer
  • Identify the mobile device deployment option that gives the user flexibility to select a device, but allows the company to contr
    5·1 answer
  • This type of connection uses radio waves to connect devices on a network.
    15·2 answers
  • The Earth's _______ is ductile overall, tending to flow very slowly and deform in a _______ manner.
    14·2 answers
  • Write a program that will ask the user to input a phrase (multiple word sentence), and an integer value. A static function will
    14·1 answer
  • 3. Before you get ready to go diving, you want to explore the area. You see a small snowpack across a small bridge, a short walk
    11·1 answer
  • Can anyone fill in the space please
    6·1 answer
  • How much RAM memory is recommended for your computer to be used as a digital darkroom?
    9·1 answer
  • what social media application that affect our day to day activities, and how did it improve our skill
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!