answer.
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
LenaWriter [7]
2 years ago
7

Given an n-element array X, algorithm D calls algorithm E on each element X[i]. Algorithm E runs in O(i) time when it is called

on element X[i]. What is the worst-case running time of algorithm D?
Computers and Technology
1 answer:
krek1111 [17]2 years ago
5 0

Answer:

O(n^2)

Explanation:

The number of elements in the array X is proportional to the algorithm E runs time:

For one element (i=1) -> O(1)

For two elements (i=2) -> O(2)

.

.

.

For n elements (i=n) -> O(n)

If the array has n elements the algorithm D will call the algorithm E n times, so we have a maximum time of n times n, therefore the worst-case running time of D is O(n^2)  

You might be interested in
Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
Aleksandr-060686 [28]

VPNs and Wifi networks use tunneling to send data privately over a network

4 0
2 years ago
A network has N subscribers. Each subscriber is connected directly to all other subscribers.
enyata [817]
Ns me plz/..................

6 0
2 years ago
During a traceroute, which action does a router perform to the value in the Time To Live (TTL) field?
Sladkaya [172]

Answer:

<em>During a traceroute, the router decreases the Time To Live values of the packet sent from the traceroute by one during routing, discards the packets whose Time To Live values have reached zero, returning the ICMP error message ICMP time exceeded.</em>

Explanation:

Traceroute performs a route tracing function in a network. It is a network diagnostic commands that shows the path followed, and measures the transit delays of packets across an Internet Protocol (IP) network, from the source to the destination, and also reports the IP address of all the routers it pinged along its path. During this process, the traceroute sends packets with Time To Live values that increases steadily from packet to packet; the process is started with Time To Live value of one. <em>At the routers, the Time To Live values of the packets is gradually decreased by one during routing, and the packets whose Time To Live values have reached zero are discarded, returning the ICMP error message ICMP Time Exceeded</em>

7 0
2 years ago
def retry(operation, attempts): for n in range(attempts): if operation(): print("Attempt " + str(n) + " succeeded") ___ else: pr
marusya05 [52]

Answer:

Following are the missing code to this question:

break;

Explanation:

In the given python code, a method "retry" is defined, that accepts two-variable, that is "operation and attempts" in its parameters, inside the method a for loop is defined that uses the n variable to holds attempt values and define the conditional statement.

  • Inside if block, it checks if the operation value is true, it will print a successful attempts values and break the condition, otherwise it will goto else block.
  • In the else block, it will print failed attempts values.  
6 0
2 years ago
Write a function which (normally) allocates new space for a double array. It should alter its pointer argument to point to the n
Fiesta28 [93]

Answer:

see explaination

Explanation:

void allocate(double *q,int size)

{

if(size<=0)

q = new double; //Allocates a single double

else

q = new double[size]; //Allocates an array of doubles

}

This function allocates new space for a double array. It alter its pointer argument to point to the newly allocated space.

4 0
2 years ago
Other questions:
  • Steps in creating a folder
    12·1 answer
  • Why are digital calendars considered to be a convenient way to maintain a study schedule?
    10·2 answers
  • a. STOP: What is a technology habit you practice today that you now realize will not help you to be successful? Explain why it’s
    13·2 answers
  • Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. Whic
    5·2 answers
  • Why would someone need to use tools like IECacheView or MyLastSearch on a system? Do companies have the right to search a workst
    11·1 answer
  • If byte stuffing is used to transmit Data, what is the byte sequence of the frame (including framing characters)? Format answer
    6·1 answer
  • Write the definition of a function power_to, which receives two parameters. The first is a float and the second is an integer. T
    5·1 answer
  • How many solutions exist for the given equation?
    9·1 answer
  • The signature area in a cover letter includes the sender's first and last name, followed by his/her job title (if applicable). *
    13·1 answer
  • Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!