please answer correctly!!   Function Growth package functiongrowth;   import java.util.Scanner;   public class FunctionGrowth {          private long start = 0;           public FunctionGrowth() {         start = System.currentTimeMillis();     }       public double elapsedTime() {         long now = System.currentTimeMillis();         return (now - start) / 1000.0;     }  private static long constant_value(long paramInt) {     long l = 0L;     for (int i = 0; i < paramInt; i++)       l += 1L;     return l;   }     private static long logarithmic(long paramInt1, long paramInt2) {     long l = 0L;     for (int i = 1; i + i <= paramInt1; i += i)       l += constant_value(paramInt2);     return l;   }   private static long sqrt(long paramInt1, long paramInt2) {     long l = 0L;     int i = 0; for (int j = 0; j < paramInt1; i++) {       l += constant_value(paramInt2);j += i;     }     return l;   }      public static long linearithmic(long paramInt1, long paramInt2) {     if (paramInt1 == 0) return 0L;     long l = 0L;     for (int i = 0; i < paramInt1; i++)       l += constant_value(paramInt2);     return linearithmic(paramInt1 / 2, paramInt2) + l + linearithmic(paramInt1 / 2, paramInt2);   }    private static long linear(long paramInt1, long paramInt2) {     long l = 0L;     for (int i = 0; i < paramInt1; i++)       l += constant_value(paramInt2);     return l;   }    private static long linearsqrt(long paramInt1, long paramInt2) {     long l = 0L;     for (int i = 0; i < paramInt1; i++) {       l += sqrt(paramInt1, paramInt2);     }     return l;   }    private static long quadratic(long paramInt1, long paramInt2) {     long l = 0L;     for (int i = 0; i < paramInt1; i++)       for (int j = 0; j < paramInt1; j++)         l += constant_value(paramInt2);     return l;   }     private static long exponential(long paramInt1, long paramInt2) {     if (paramInt1 == 0) return constant_value(paramInt2);     return exponential(paramInt1 - 1, paramInt2) + exponential(paramInt1 - 1, paramInt2);   }     private static long factorial(long paramInt1, long paramInt2) {     if (paramInt1 == 0) return constant_value(paramInt2);     long l = 0L;     for (int i = 0; i < paramInt1; i++)       l += factorial(paramInt1 - 1, paramInt2);     return l;   }     public static long Order(long N)  {       long num = 0L;             int sum = 0;             for(int i=0; i < N; i++) {           for(int j = 1; j <= N*N; j=j*2 ) {               sum++;            }       }       num=sum;       return num;     }        static Scanner input = new Scanner(System.in);             public static void main(String[] args) {         long value = 0L;                 value = Order(constant_value(5));         System.out.println("Constant Result: " +value);          value = Order(logarithmic(5,10));         System.out.println("Logarithmic Result: " +value);         value = Order(sqrt(5,10));         System.out.println("Sqrt Result: " +value);         value = Order(linearithmic(5,10));         System.out.println("Linearithmic Result: " +value);         value = Order(linear(5,10));         System.out.println("Linear Result: " +value);         value = Order(linearsqrt(5,10));         System.out.println("Linear Sqrt Result: " +value);         value = Order(quadratic(5,10));         System.out.println("Quadratic Result: " +value);         value = Order(exponential(5,10));         System.out.println("Exponential Result: " +value);         value = Order(factorial(5,10));         System.out.println("Factorial Result: " +value);             }     }

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

please answer correctly!!

 

Function Growth

package functiongrowth;

 

import java.util.Scanner;

 

public class FunctionGrowth {

   

     private long start = 0;

 

   

    public FunctionGrowth() {

        start = System.currentTimeMillis();

    }

 

    public double elapsedTime() {

        long now = System.currentTimeMillis();

        return (now - start) / 1000.0;

    }

 private static long constant_value(long paramInt) {

    long l = 0L;

    for (int i = 0; i < paramInt; i++)

      l += 1L;

    return l;

  }

 

  private static long logarithmic(long paramInt1, long paramInt2) {

    long l = 0L;

    for (int i = 1; i + i <= paramInt1; i += i)

      l += constant_value(paramInt2);

    return l;

  }

  private static long sqrt(long paramInt1, long paramInt2) {

    long l = 0L;

    int i = 0; for (int j = 0; j < paramInt1; i++) {

      l += constant_value(paramInt2);j += i;

    }

    return l;

  }

 

   public static long linearithmic(long paramInt1, long paramInt2) {

    if (paramInt1 == 0) return 0L;

    long l = 0L;

    for (int i = 0; i < paramInt1; i++)

      l += constant_value(paramInt2);

    return linearithmic(paramInt1 / 2, paramInt2) + l + linearithmic(paramInt1 / 2, paramInt2);

  }

   private static long linear(long paramInt1, long paramInt2) {

    long l = 0L;

    for (int i = 0; i < paramInt1; i++)

      l += constant_value(paramInt2);

    return l;

  }

   private static long linearsqrt(long paramInt1, long paramInt2) {

    long l = 0L;

    for (int i = 0; i < paramInt1; i++) {

      l += sqrt(paramInt1, paramInt2);

    }

    return l;

  }

   private static long quadratic(long paramInt1, long paramInt2) {

    long l = 0L;

    for (int i = 0; i < paramInt1; i++)

      for (int j = 0; j < paramInt1; j++)

        l += constant_value(paramInt2);

    return l;

  }

 

  private static long exponential(long paramInt1, long paramInt2) {

    if (paramInt1 == 0) return constant_value(paramInt2);

    return exponential(paramInt1 - 1, paramInt2) + exponential(paramInt1 - 1, paramInt2);

  }

 

  private static long factorial(long paramInt1, long paramInt2) {

    if (paramInt1 == 0) return constant_value(paramInt2);

    long l = 0L;

    for (int i = 0; i < paramInt1; i++)

      l += factorial(paramInt1 - 1, paramInt2);

    return l;

  }

 

  public static long Order(long N)  {

      long num = 0L;

     

      int sum = 0;

     

      for(int i=0; i < N; i++) {

          for(int j = 1; j <= N*N; j=j*2 ) {

              sum++;

           }

      }

      num=sum;

      return num;

 

  }     

  static Scanner input = new Scanner(System.in);

 

   

 

    public static void main(String[] args) {

        long value = 0L;

       

        value = Order(constant_value(5));

        System.out.println("Constant Result: " +value);

         value = Order(logarithmic(5,10));

        System.out.println("Logarithmic Result: " +value);

        value = Order(sqrt(5,10));

        System.out.println("Sqrt Result: " +value);

        value = Order(linearithmic(5,10));

        System.out.println("Linearithmic Result: " +value);

        value = Order(linear(5,10));

        System.out.println("Linear Result: " +value);

        value = Order(linearsqrt(5,10));

        System.out.println("Linear Sqrt Result: " +value);

        value = Order(quadratic(5,10));

        System.out.println("Quadratic Result: " +value);

        value = Order(exponential(5,10));

        System.out.println("Exponential Result: " +value);

        value = Order(factorial(5,10));

        System.out.println("Factorial Result: " +value);

       

    }

   

}

The test below the codes using the file found in Lab Activity 2 resource above this assignment page with the following parameters.
Parameter 1
Parameter 2
10
7
15
8
20
9.
25
10
30
Save your file in EXCEL format using your LASTNAME. Plot the results using Line and Bar charts.
Transcribed Image Text:The test below the codes using the file found in Lab Activity 2 resource above this assignment page with the following parameters. Parameter 1 Parameter 2 10 7 15 8 20 9. 25 10 30 Save your file in EXCEL format using your LASTNAME. Plot the results using Line and Bar charts.
Expert Solution
steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY