# Middle

class Middle : PivotByAlgorithm.Type

The pivot is taken to be the middle item of the list since this is more likely to create a balanced layout.

Complexity: O(n log n) worst case, where n is the number of nodes in the tree.

## Constructors

Middle
Link copied to clipboard
constructor()

## Functions

computePivotIndex
Link copied to clipboard
open override fun <N> computePivotIndex(children: Array<N>, accessor: TreeMapAccessor<N>): Int

Compute the pivot index

toString
Link copied to clipboard
open override fun toString(): String