Package com.macrofocus.treemap
Class PivotByAlgorithm.Biggest
- java.lang.Object
-
- com.macrofocus.treemap.PivotByAlgorithm.Biggest
-
- All Implemented Interfaces:
PivotByAlgorithm.Type
- Enclosing class:
- PivotByAlgorithm
public static class PivotByAlgorithm.Biggest extends java.lang.Object implements PivotByAlgorithm.Type
The pivot is taken to be the item with the largest area since the largest item is the most difficult to place. 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 Biggest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computePivotIndex(TreeMapNode[] children)
Compute the pivot indexjava.lang.String
toString()
-
-
-
Method Detail
-
computePivotIndex
public int computePivotIndex(TreeMapNode[] children)
Description copied from interface:PivotByAlgorithm.Type
Compute the pivot index- Specified by:
computePivotIndex
in interfacePivotByAlgorithm.Type
- Parameters:
children
- the nodes- Returns:
- the index of the node to use as a pivot
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-