Class PivotByAlgorithm.Middle

  • All Implemented Interfaces:
    PivotByAlgorithm.Type
    Enclosing class:
    PivotByAlgorithm

    public static class PivotByAlgorithm.Middle
    extends java.lang.Object
    implements 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.

    • Constructor Summary

      Constructors 
      Constructor Description
      Middle()  
    • Constructor Detail

      • Middle

        public Middle()
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object