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
Andreas93 [3]
3 years ago
15

Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore co

mparisons to check while conditions).
i =1
t = 0
while i <= n
i = t+i
t = 2i
Computers and Technology
1 answer:
Novay_Z [31]3 years ago
6 0
<span>'m pretty sure the big O is actually O(log n) Not really a proof but anyway. If you write out the values before each iteration of the loop you get. L - iteration number L i t 1 1 0 2 1 2 3 3 6 4 9 18 5 27 54 6 81 162 So if n was 80 it would take 6 iterations You can see i is growing like 3^(L-2) So if n was 1000 1000 = 3^(L-2) log(1000) [base 3] = L - 2 log(1000) [base 3] + 2 = L 8.287709822868152 = L and if you ceil the answer you get L = 9 and just to check with the table 6 81 162 7 243 486 8 729 1458 9 2187 ... The table isn't perfect but hopefully you get the main idea.</span>
You might be interested in
Fill in the blank
EastWind [94]

Answer:

It is called the ENQUIRE database

Explanation: got it right boooiiiii

7 0
3 years ago
Read 2 more answers
What kind of software consists of the programs that control or maintain the operations of a computer and its devices?
patriot [66]
Instructional coding hope this helps
6 0
3 years ago
Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy’s name,
insens350 [35]

Answer:

Check Explanation.

Explanation:

A programming language is used by engineers, technologists, scientists or someone that learnt about programming languages and they use these programming languages to give instructions to a system. There are many types for instance, c++, python, Java and many more.

So, the solution to the question above is given below;

#define the lists

boyNames=[]

girlNames=[]

#open the text file BoyNames.txt

with open('BoyNames.txt','r') as rd_b_fl:

boyNames=rd_b_fl.readlines()

boyNames=[name.strip().lower() for name in boyNames]

#open the text file GirlNames.txt

with open('GirlNames.txt','r') as rd_b_fl:

girlNames=rd_b_fl.readlines()

girlNames=[name.strip().lower() for name in girlNames]

#print the message to prompt for name

print('Enter a name to see if it is a popular girls or boys name.')

while True:

#prompt and read the name

name=input('\nEnter a name to check, or \"stop\" to stop: ').lower()

# if the input is stop, then exit from the program

if name=='stop':

break

# If the girl name exits in the file,then return 1

g_count=girlNames.count(name)

# if return value greater than 0, then print message

if g_count>0:

print(name.title()+" is a popular girls name and is ranked "

+str(girlNames.index(name)+1))

# if return value greater than 0, then print message

#"Not popular name"

else:

print(name.title()+" is not a popular girls name")

## If the boy name exits in the file,then return 1

b_count=boyNames.count(name)

if b_count>0:

print(name.title()+" is a popular boys name and is ranked "

+str(boyNames.index(name)+1))

# if return value greater than 0, then print message

#"Not popular name"

else:

print(name.title()+" is not a popular boys name")

3 0
3 years ago
Software is the brain of computer. Explain this starement
Annette [7]

here you go

i hope this helps you

5 0
3 years ago
Edhesive unit 4 test
sergij07 [2.7K]

Answer:

padna jana ta yarrr kasto this yarr

8 0
3 years ago
Other questions:
  • Steve is proofreading his memo and he notices that he has typed a phrase twice. Steve should _____.
    5·2 answers
  • What does the rule of five say?
    12·2 answers
  • Need help ASAP Examples of utilities that make it possible for people to create and share multimedia files include _____. audio
    9·2 answers
  • If a client is found _________ the NAP will attempt to make it _______. Group of answer choices A. non-compliant, compliant B. s
    13·2 answers
  • How do you compare text on different pages of a document?
    14·1 answer
  • HELPPPP PLEASE HURRY
    15·1 answer
  • Witch icon allows you to see paragraph formatting feature
    6·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • As Jane was setting up her projector, she realized that the images on the screen appeared blurred. How would Jane sort out the i
    6·2 answers
  • Hazel has taught herself a variety of computer languages. She enjoys using her knowledge to write the programs for applications
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!