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
Yuliya22 [10]
2 years ago
6

How do we find the time complexity for this algorithm?

Computers and Technology
1 answer:
gizmo_the_mogwai [7]2 years ago
8 0

Answer:

For any loop, we find out the runtime of the block inside them and multiply it by the number of times the program will repeat the loop. All loops that grow proportionally to the input size have a linear time complexity O(n) . If you loop through only half of the array, that's still O(n) .

You might be interested in
The following pseudocode is an example of ____.do stepAdo stepBif conditionC is true thendo stepDelsedo stepEendifwhile conditio
rewona [7]

Answer:

Option d pretest

Explanation:

Given the pseudocode:

  1. do stepA
  2. do stepB
  3. if conditionC is true
  4. then do stepD
  5. else
  6. do stepE
  7. end if
  8. while conditionF is true
  9. do stepG
  10. end while

The pseudocode above shows that there is a pretest before some codes are executed. For example, line 3 check if condition is true then only execute stepD otherwise execute stepE. Line 8 check if conditionF is true then repeatedly execute stepG. These are examples of pretest a condition will must be met (pretest passed) before a block of codes can be executed. This pretest can be seen in if-else statements and also the while condition.  

6 0
3 years ago
What command launches the remote desktop client for windows?
Ksju [112]
%windir%\system32\mstsc.exe

launches the RDP client.
7 0
3 years ago
Which measure should you take for the periodic maintenance of your computer?
WITCHER [35]
I believe the answer is annual maintenance
Hope this helps :p
6 0
3 years ago
Read 2 more answers
How does the game Clash Royale keep players continuously active and engaged?
lana [24]

Answer: a

Explanation: because they have to beat and check the players to move on

4 0
3 years ago
Who wants to join my zoom after school 23456+4567
tensa zangetsu [6.8K]
Meeeeeeeeeeeeeeeeeeee
5 0
3 years ago
Other questions:
  • Why is it important to ensure that dns servers have been secured before implementing an e-mail system? awr138?
    10·1 answer
  • What languages other than English are spoken in the United States?
    14·1 answer
  • Over the past few years a very definite need has arisen in the electrical trades for:
    15·1 answer
  • Assume you are a network consultant for a company that is designing a private WAN to communicate between five locations spread t
    10·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • What is an advantage of a computer network ? networked
    13·2 answers
  • What do the buttons on the paste options menu do
    11·1 answer
  • I need le help, darn ijourneys
    10·2 answers
  • A profit of ₹ 1581 is to be divided amongst three partner P,Q and R in ratio 1/3:1/2:1/5.theshareof R will be?​
    10·1 answer
  • 8.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!