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
A client is asking for a printing solution that will print three sheets of paper with identical information on each page with a
Sergeu [11.5K]

According to the requirements of the client, the printing solution should print three sheets of paper with identical information on each page with a single pass of the printer.

<u>Explanation:</u>

Furthermore, the client requests that it should take the least amount of time and effort to maintain. The printer type according to the requirements should be an impact printer.

Impact printers suit the needs of the client and are easy to maintain due to the low cost. Also, they print by making physical contact with the paper and have a significant speed of printing.

7 0
2 years ago
Which characteristic of Cloud computing allows data centers to better manage hard drive failures and allocate computing resource
MrMuchimi

Answer:

When working with cloud computing, drive failures and need for usage and data is easily identifiable, so in short term, all of the things that show the user/s what needs to be done is the characteristic.

Explanation:

5 0
2 years ago
f the copyright date on the homepage is more than 1 year old, the website should always be considered unmaintained
Lilit [14]
We still have moderators who watch the site every day they are in the process of acquiring a new one 
4 0
2 years ago
An administrator wants to create four subnetworks from the network address 192.168.1.0/24. what is the network address and subne
Vitek1552 [10]
<span>There is a total of 32 bits in </span>IPv4 address space. In this case we have /24, which means <span>that 24 bits are contained in the network. So, the </span><span>
subnetwork  is 192.168.1.64
subnet mask 255.255.255.192</span>
8 0
2 years ago
Writing in Java, write a program that prompts the user to input an integer and then outputs both the individual digits of the nu
larisa [96]

Answer:

//Here is code in java.

import java.util.*;

class Main

{

public static void main (String[] args) throws java.lang.Exception

{

   try{

       int in;

     //scanner class object to read the input

    Scanner scr=new Scanner(System.in);

     // variable to keep running total

    int total=0;

    System.out.println("please enter an Integer:");

     // read the input first time

    in=scr.nextInt();

    System.out.print("individual digits of "+in+" is ");

    if(in<0)

    {

        in=-(in);

    }

   

 

     //call the function to print the digits of number

   print_dig(in);

   System.out.println();

    //calculate the sum of all digits

   do{

       int r=in%10;

       total=total+r;

       in=in/10;

   }while(in>0);

    //print the sum

   System.out.println("total of digits is: "+total);

     

   }catch(Exception ex){

       return;}

}

 //recursive function to print the digits of number

public static void print_dig(int num)

{  

    if(num==0)

    return;

    else

    {

    print_dig(num/10);

    System.out.print(num%10+" ");

    }

}

}

Explanation:

Read a number with the help of object of scanner class.if the input is negative

then make it positive number before calling the function print_dig().call

the recursive method print_dig() with parameter "num".It will extract the digits

of the number and print then in the order. Then in the main method, calculate

sum of all the digits of number.

Output:

please enter an Integer:                                                                                                  

3456                                                                                                                      

individual digits of 3456 is 3 4 5 6                                                                                      

total of digits is: 18

please enter an Integer:                                                                                                  

-2345                                                                                                                      

individual digits of -2345 is 2 3 4 5                                                                                      

total of digits is: 14

6 0
2 years ago
Other questions:
  • Which table style option is useful to display aggregated data when it is checked? total row filter button last column header row
    8·1 answer
  • Which process is used to protect transmitted data in a vpn?
    12·1 answer
  • What two methods can be used to access and modify an existing program that is running on an iot device in cisco packet tracer? (
    6·1 answer
  • _____ computing refers to a computing environment that is always present, can feel our surroundings, and-based on who we are, wh
    8·1 answer
  • #Create a class called Name. Name should have two attributes
    11·1 answer
  • PC’s &amp; More has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of its cust
    14·1 answer
  • System design is the determination of the overall system architecture-consisting of a set of physical processing components, ___
    6·2 answers
  • In the lab, you discovered that the server you scanned (10.20.1.2) was vulnerable to the WannaCry ransomeware attack. What ports
    15·1 answer
  • Which of the following is not true of how computers represent complex information
    5·2 answers
  • Given a sorted list of integers, output the middle integer. A negative number indicates the end of the input (the negative numbe
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!