public class DoublingTest extends Object
DoublingTest
class provides a client for measuring
the running time of a method using a doubling test.
For additional documentation, see Section 1.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Prints table of running times to call
ThreeSum.count()
for arrays of size 250, 500, 1000, 2000, and so forth. |
static double |
timeTrial(int n)
Returns the amount of time to call
ThreeSum.count() with n
random 6-digit integers. |
public static double timeTrial(int n)
ThreeSum.count()
with n
random 6-digit integers.n
- the number of integersThreeSum.count()
with n random 6-digit integerspublic static void main(String[] args)
ThreeSum.count()
for arrays of size 250, 500, 1000, 2000, and so forth.args
- the command-line arguments