Package com.treemap
Class PivotByAlgorithm.SplitSize
java.lang.Object
com.treemap.PivotByAlgorithm.SplitSize
- All Implemented Interfaces:
PivotByAlgorithm.Type
- Enclosing class:
PivotByAlgorithm
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 -
Method Summary
Modifier and TypeMethodDescriptionintcomputePivotIndex(TreeMapNode[] children) Compute the pivot indextoString()
-
Constructor Details
-
SplitSize
public SplitSize()
-
-
Method Details
-
computePivotIndex
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
-