Class ComplexityEvaluator.ComplexityBundle

java.lang.Object
solvers.queueingnet.treeAlgorithms.ComplexityEvaluator.ComplexityBundle
Enclosing class:
ComplexityEvaluator

protected class ComplexityEvaluator.ComplexityBundle extends Object
Internal class for storing and comparing time and space complexities.
Author:
Ben Homer, 2014.
  • Field Details

    • timeComplexity

      public int timeComplexity
      The time complexity.
    • spaceComplexity

      public int spaceComplexity
      The space complexity.
  • Constructor Details

    • ComplexityBundle

      public ComplexityBundle(int timeComplexity, int spaceComplexity)
      Constructor.
      Parameters:
      timeComplexity - The time complexity.
      spaceComplexity - The space complexity.
  • Method Details

    • add

      Adds this ComplexityBundle (time and space) to another and returns the result.
      Parameters:
      c - The ComplexityBundle the add the local space and time complexities to.
      Returns:
      The combined ComplexityBundle.
    • hasBetterTimeComplexity

      public boolean hasBetterTimeComplexity(ComplexityEvaluator.ComplexityBundle c)
      Determines if the local ComplexityBundle has better time complexity than another specified ComplexityBundle.
      Parameters:
      c - The ComplexityBundle to check against.
      Returns:
      A boolean indication whether the local ComplexityBundle has better time complexity than the other specified ComplexityBundle.
    • hasBetterSpaceComplexity

      public boolean hasBetterSpaceComplexity(ComplexityEvaluator.ComplexityBundle c)
      Determines if the local ComplexityBundle has better space complexity than another specified ComplexityBundle.
      Parameters:
      c - The ComplexityBundle to check against.
      Returns:
      A boolean indication whether the local ComplexityBundle has better space complexity than the other specified ComplexityBundle.
    • hasBetterCombinedComplexity

      public boolean hasBetterCombinedComplexity(ComplexityEvaluator.ComplexityBundle c)
      Determines if the local ComplexityBundle has better time and space complexity than another specified ComplexityBundle.
      Parameters:
      c - The ComplexityBundle to check against.
      Returns:
      A boolean indication whether the local ComplexityBundle has better time and space complexity than the other specified ComplexityBundle.