Package com.macrofocus.treemap
Class PivotByAlgorithm.SplitSize
- java.lang.Object
-
- com.macrofocus.treemap.PivotByAlgorithm.SplitSize
-
- All Implemented Interfaces:
PivotByAlgorithm.Type
- Enclosing class:
- PivotByAlgorithm
public static class PivotByAlgorithm.SplitSize extends java.lang.Object implements PivotByAlgorithm.Type
Selects the pivot that will split L1 and L3 into approximately equal total areas. Complexity: O(n log n) average, O(n^2) worst case, where n is the number of nodes in the tree.
-
-
Constructor Summary
Constructors Constructor Description SplitSize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomputePivotIndex(TreeMapNode[] children)Compute the pivot indexjava.lang.StringtoString()
-
-
-
Method Detail
-
computePivotIndex
public int computePivotIndex(TreeMapNode[] children)
Description copied from interface:PivotByAlgorithm.TypeCompute the pivot index- Specified by:
computePivotIndexin interfacePivotByAlgorithm.Type- Parameters:
children- the nodes- Returns:
- the index of the node to use as a pivot
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-