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
siniylev [52]
3 years ago
7

Suppose we perform a sequence of n operations on a data structure such that if some condition C(k) holds then the kth operation

takes O(k) time, but otherwise it only takes O(1) time. For each condition C(k) listed below, determine the total time T(n) for the sequence of all n operations, and also the amortized time Tamortized(n) per each operation
a) If C(k) is "k is a power of 3" then T(n)-O(n4/) and Tamortized(n) O(n13).
b) If C(k) is "k is a multiple of 2" then T(n)-O(n) and Tamortized(n)=O (1).
c) If C(k) is "k is a perfect square" then T(n) O(n4/3) and Tamortized(n)=O(n13). O
d) If C(k) is "k is a multiple of 2" then T(n)=O(n2) and Tamortized(n)=O(n)
Computers and Technology
1 answer:
GrogVix [38]3 years ago
7 0

Answer:

stay home, stay safe, dont get corona virus

Explanation:

You might be interested in
Raid level 6 is basically the same as RAID level 5, but it adds a second set of parity bits for added fault tolerance and allows
Leviafan [203]

Answer:

True

Explanation:

3 0
3 years ago
Explain why much of social media marketing is trial and error.
Ivahew [28]
The first thing that entrepreneurs need to realize is that the process and framework for making social media marketing work are different from traditional marketing, and trial and error certainly doesn’t work. Ric Dragon, an expert in online marketing, in his new book “Social Marketology<span>,” outlined the best set of steps I have seen so far for the new world:</span>
7 0
3 years ago
The Polish mathematician Wacław Sierpiński described the pattern in 1915, but it has appeared in Italian art since the 13th cent
soldi70 [24.7K]

Answer:

/ Sierpinski.java

public class Sierpinski {

     // method to find the height of an equilateral triangle with side length =

     // length

     public static double height(double length) {

           // formula= length*sqrt(3)/2

           double h = (length * Math.sqrt(3)) / 2.0;

           return h;

     }

     // method to draw a filled triangle (pointed downwards) with bottom vertex

     // x,y

     public static void filledTriangle(double x, double y, double length) {

           // finding height

           double h = height(length);

           // filling triangle as a polygon

           // passing x, x-length/2, x+length/2 as x coordinates

           // and y, y+h, y+h as y coordinates

           StdDraw.filledPolygon(new double[] { x, x - (length / 2.0),

                       x + (length / 2.0) }, new double[] { y, y + h, y + h });

     }

     // method to draw an n level sierpinski triangle

     public static void sierpinski(int n, double x, double y, double length) {

           // checking if n is above 0 (base condition)

           if (n > 0) {

                 // drawing a filled triangle with x, y as bottom coordinate, length

                 // as side length

                 filledTriangle(x, y, length);

                 // drawing the triangle(s) on the top

                 sierpinski(n - 1, x, y + height(length), length / 2);

                 // drawing the triangle(s) on the left side

                 sierpinski(n - 1, x - (length / 2.0), y, length / 2);

                 // drawing the triangle(s) on the right side

                 sierpinski(n - 1, x + (length / 2.0), y, length / 2);

           }

     }

     public static void main(String[] args) {

           // parsing first command line argument as integer, if you dont provide

           // the value while running the program, this program will cause

           // exception.

           int n = Integer.parseInt(args[0]);

           // length of the outline triangle

           double length = 1;

           // finding height

           double h = height(length);

           // drawing a triangle (pointed upwards) to represent the outline.

           StdDraw.polygon(new double[] { 0, length / 2, length }, new double[] {

                       0, h, 0 });

           // drawing n level sierpinski triangle(s) with length / 2, 0 as x,y

           // coordinates and length / 2 as initial side length

           sierpinski(n, length / 2, 0, length / 2);

     }

}

7 0
2 years ago
Write an if-else statement that displays 'Speed is normal' if the speed variable is within the range of 24 to 56. If the speed v
kari74 [83]

Answer:

import java.util.Scanner;

public class Speed{

int speed;

public Speed(int speed){

this.speed = speed;

}

public void checkSpeed(){

if(speed >= 24 || speed <= 56){

System.out.println("Speed is normal");

}

else

System.out.println("Speed is abnormal");

}

public static void main(String...args){

Scanner input = new Scanner(System.in);

int userSpeed = 0;

System.out.println("Enter a speed: ");

userSpeed = input.nextInt();

Speed obj1 = new Speed(userSpeed)

obj1.checkSpeed();

}

Explanation:

4 0
3 years ago
What are the advantages and disadvantages of nuclear energy?
Vilka [71]
Advantages: Nuclear energy has the ability to produce electricity without greenhouse gas emissions. It produces electricity without pollution

Disadvantages: The nuclear weapons threats. Some reactors produce plutonium which can be used to make nuclear weapons
7 0
3 years ago
Other questions:
  • Define the following term: - hue
    11·2 answers
  • Write an expression to print each price in stock_prices. sample output for the given program: $ 34.62 $ 76.30 $ 85.05
    6·1 answer
  • Which of the following should be considered when conducting an audience analysis ?
    13·2 answers
  • Jill is setting up a presentation and wants to use a built-in equation, such as the area of a triangle. To insert this in her pr
    14·2 answers
  • When might be the best time to start saving for retirement?
    5·2 answers
  • What is the best information to include in the template name to differentiate it from other templates? Check all that apply.
    6·1 answer
  • Rewriting notes into complete sentences is unnecessary if you want to include the notes in your study guide. Truth or false?
    15·2 answers
  • Use of multimedia in business sector...​?
    5·1 answer
  • Converting Denary to Binary
    15·1 answer
  • Witch icon allows you to see paragraph formatting feature
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!