Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Study the impact of O() on a problem solution and learn to design and tweak an experiment (in java): 1 - Use the 3 different

Study the impact of O() on a problem solution and learn to design and tweak an experiment (in java):

1 - Use the 3 different algorithms for Maximum Contiguous Subsequence Sum, you can copy the code from http://www.crazyforcode.com/maximum-sum-in-contiguous-subarray/ - Give credit. You will need to tweak the code to make it work. You can also simplify the code...

2 - Use StopWatch class from the book for timing

Book's StopWatch example:

public class Stopwatch {

private final long start;

public Stopwatch() {

start = System.currentTimeMillis();

}

public double elapsedTime() {

long now = System.currentTimeMillis();

return (now - start) / 1000.0;

}

}

3 - Build a tester that: * Generates datasets randomly * Run all 3 algorithm with each generated dataset * You will need multiple test-runs to establish N such that value of T(N) are neither too short (Resolution is mili-second) or too long (Longer than ~ 1 day) * Initially loop multiplying the dataset size by 2 (Initial multiplier) every time

4- estimate a good starting N

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

How does the EEOC define sexual harassment?

Answered: 1 week ago

Question

What is dividend payout ratio ?

Answered: 1 week ago

Question

Explain the factors affecting dividend policy in detail.

Answered: 1 week ago