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
Use the single-server drive-up bank teller operation referred to in Problems 1 and 2 to determine the following operating charac
elena-s [515]

Answer:

This question is incomplete, here's the complete question:

1. Willow Brook National Bank operates a drive-up teller window that allows customers to complete bank transactions without getting out of their cars. On weekday mornings, arrivals to the drive-up teller window occur at random, with an arrival rate of 24 customers per hour or 0.4 customers per minute. 3. Use the single-server drive-up bank teller operation referred to in Problems 1 to determine the following operating characteristics for the system: a.) The probability that no customers are in the system. b.) The average number of customers waiting. c.) The average number of customers in the system. d.) The average time a customer spends waiting. e.) The average time a customer spends in the system. f.) The probability that arriving customers will have to wait for service.

Explanation:

Arrival rate \lambda = 24 customers per hour or 0.4 customers per minute

Service rate \mu​ = 36 customers per hour or 0.6 customers per minute (from problem 1)

a.) The probability that no customers are in the system , P0 = 1 - \lambda / \mu

= 1 - (24/36) = 1/3 = 0.3333

b.) The average number of customers waiting

Lq = \lambda^2 / [\mu(\mu - \lambda)] = 242 / [36 * (36 - 24)] = 1.33

c.) The average number of customers in the system.

L = Lq + \lambda / \mu = 1.33 + (24/36) = 2

d.) The average time a customer spends waiting.

Wq = \lambda / [\mu(\mu - \lambda)] = 24 / [36 * (36 - 24)] = 0.0555 hr = 3.33 min

e.) The average time a customer spends in the system

W = Wq + 1/\mu = 0.0555 + (1/36) = 0.0833 hr = 5 min

f.) The probability that arriving customers will have to wait for service.

= 1 - P0 = 1 - 0.3333 = 0.6667

3 0
1 year ago
1.2.2: Output variable value. Jump to level 1 Write a statement that outputs variable userAge. End with a newline. 1 2 3 4 5 6 7
serg [7]

Answer:

cout<<"User Age is ="<<userAge<<endl;

Explanation:

#include<iostream>

using namespace std;

int main()

{

int userAge;

cin >> userAge; // Program will be tested with values: 15, 40.

cout<<"User Age is ="<<userAge<<endl;

return 0;

}

5 0
2 years ago
Dr. Robbins wants to know if there are different opinions regarding the value of public school education between Native American
zmey [24]

Answer:

The independent variable is Native American participants

Explanation:

Why Native Americans is the independent variable is bacause the survey population is Native Americans and the result of the survey won't be affected by the gender and age of the native american participants. So it the independent variable.

5 0
2 years ago
When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
aksik [14]

Answer:

a.JavaScript

Explanation:

<em>Form validation</em> is adopted to prevent the abuse of web form by malicious users, data that are not properly validated causes or leads to security vulnerabilities, thereby making a website to be at a risk of being attacked by malicious users.

<em>Validation rules</em> checks that the data a user enters in a record meets the specify standards before the user is allowed to save the record, a validation rule evaluates the data in one or more fields and return it as true or false.

<em>JavaScript form validation  can be used to check all required fields, the steps are adopted are:</em>

<em>i) Basic validation − The form is first checked to make sure that all the mandatory fields are filled.</em>

<em>ii) Data format validation −The data that is entered is then checked for correct form and value before allowing to proceed, submit or save the record.</em>

6 0
1 year ago
Design a BCD-to-Gray code decoder. Your decoder will have 4 inputs: A, B, C and D, representing a 4-bit BCD code (A being the MS
ra1l [238]

Answer:

Binary to Gray Code Converter

The logical circuit which converts the binary code to equivalent gray code is known as binary to gray code converter. An n-bit gray code can be obtained by reflecting an n-1 bit code about an axis after 2n-1 rows and putting the MSB (Most Significant Bit) of 0 above the axis and the MSB of 1 below the axis.

The 4 bit binary to gray code conversion table is given in attached file.

3 0
1 year ago
Read 2 more answers
Other questions:
  • An electronics store purchased a CD player at a wholesale price of $60 and then sold it at a 40 percent discount off the origina
    13·1 answer
  • Which of the following are true statements about digital certificates in Web browsers?I. Digital certificates are used to verify
    10·1 answer
  • The Paste Options button labeled ____ is used if you want the pasted chart not to be linked to the source document but you want
    9·1 answer
  • Address the FIXME comments. Move the respective code from the while-loop to the created function. The add_grade function has alr
    14·1 answer
  • Software as a Service (SaaS) refers to the use of computing resources, including software and data storage, on the Internet rath
    13·1 answer
  • Represent the logic of a program that allows the user to enter a value for one edge of a cube. The program calculates the surfac
    10·1 answer
  • In Section 8.5.4, we described a situation in which we prevent deadlock by ensuring that all locks are acquired in a certain ord
    11·1 answer
  • Which of these tools can best be used as a self assessment for career planning purposes? a personality test an asset analysis a
    5·1 answer
  • PLEASE HELP!!!
    11·1 answer
  • Prompt
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!