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
Helen [10]
3 years ago
12

How to understand amortized analysis potential?

Computers and Technology
1 answer:
MA_775_DIABLO [31]3 years ago
4 0
Since you gave kind of a vague question. I'll just go with the basics. Amortized analysis in computer science is basically the study of worst case run times regarding a sequence of operations.

When looking at potential, it is the physicist's method.
phi (initial state) =0 and every state after is larger than 0.
It keeps track of time but relies on states to know where it is.

The equation C +phi (state')-phi(state) is the main equation. C is the time for an operation, "state" is before and "state'" is after.

There are sets of equations that dictate average run time with this.

ex.
phi (H)= 2n-m. n=number of elements, m=size of array.
This equation is used to calculate the time to double the size.
You might be interested in
What is Selection statement?​
Sati [7]

Answer:

Selection statements (sometimes called conditional statements) can be defined as code (statements) that is executed only when a certain condition is satisfied.Selection is a powerful tool to control when and which code statements will run.

3 0
3 years ago
Read 2 more answers
Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. It should
HACTEHA [7]

Answer:

speed = float(input("Enter the speed: "))

hours = int(input("Enter the hours: "))

distance = 0

for i in range(hours):

   distance += speed * 1

   print("The distance after " + str(i+1) + ". hour(s): " + str(distance))

Explanation:

*The code is in Python.

Ask the user to enter the speed and the hours

Initialize the distance as 0

Create a for loop that iterates hours times. Inside the loop, calculate the cumulative distance traveled at the end of each hour and print it (Note that the distance = speed x hour)

5 0
3 years ago
1. Implement a method factorial(int n), that takes a number (int) and returns its factorial. Factorial of an integer is the prod
marysya [2.9K]

Answer:

import java.io.*;

import java.util.*;

public class Main

{

public static int factorial(int n){

if (n == 0)

return 1;    

else

return(n * factorial(n-1)); //recursively calling factorial function

}

public static void fibbonaci(int n)

{

if(n>0)

{

c=a+b; //next term in series

a=b;

b=c;

System.out.print(" "+c);    

fibbonaci(n-1); //recursively calling fibbonaci function

}

}

static int a=0,b=1,c;

  public static void main(String[] args) {

  int list_num,fact;

      List<Integer> num=Arrays.asList(1,3,5,7,9); //arraylist with 1,3,5,7,9

      for(Integer i:num) //for-each loop

      {    

      a=0;

      b=1;

      list_num=i.intValue();

      System.out.println("Fibbonaci series for "+list_num);

      System.out.print(a+" "+b);

      fibbonaci(list_num-2); //calling fibbonaci for values in list

      fact=factorial(list_num); //calling factorial for values in list

      System.out.println();

      System.out.println("Factorial for "+list_num+" is "+fact);

      System.out.println();

     

      }

  }

}

6 0
4 years ago
Which statement is true regarding Artificial Intelligence (AI)?
Effectus [21]
Data is the fundamental reason AI succeeds or fails.
This statement is true regarding Artificial Intelligence (AI)
6 0
3 years ago
Which of the following is NOT an example of written communication?
Veronika [31]

Answer:A conversation between co-workers

Explanation:

4 0
3 years ago
Other questions:
  • A user reports that nothing happens when he or she attempts to print from the computer at his desk. This points to a possible pr
    11·2 answers
  • Many programmers today use a(n) _________, which is software that helps them build their computer programs. eula cad sdlc ide
    15·1 answer
  • (Please answer! Correct answer gets brainliest!)
    5·2 answers
  • Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fe
    13·1 answer
  • Maria works for MegaCorp, a large privately owned company specializing in sales of ball bearings. MegaCorp introduces filtering
    15·1 answer
  • ___MSDS provides information on how to handle, store, discard and care for potentially hazardous chemicals. true or false?​
    5·1 answer
  • You make an online purchase of a hooded sweatshirt with the logo of the Dallas Cowboys. The next time you log on, your screen ha
    13·1 answer
  • Write a program that asks the user to enter a series of single digit numbers with nothing separating them. Read the input as a C
    12·1 answer
  • Which two components are configured via software in order for a PC to participate in a network environment
    5·1 answer
  • Answer the questions about PowerPoint using the drop-down menus,
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!