类 DoublingTest


  • public class DoublingTest
    extends java.lang.Object
    The 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.

    • 方法概要

      修饰符和类型 方法 说明
      static void main​(java.lang.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.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • timeTrial

        public static double timeTrial​(int n)
        Returns the amount of time to call ThreeSum.count() with n random 6-digit integers.
        参数:
        n - the number of integers
        返回:
        amount of time (in seconds) to call ThreeSum.count() with n random 6-digit integers
      • main

        public static void main​(java.lang.String[] args)
        Prints table of running times to call ThreeSum.count() for arrays of size 250, 500, 1000, 2000, and so forth.
        参数:
        args - the command-line arguments