OptimizedQuickSort class

Optimized QuickSort with median-of-three pivot selection.

This variant improves performance by choosing a better pivot using the median of the first, middle, and last elements. This reduces the likelihood of worst-case O(n²) behavior.

Improvements over basic QuickSort:

  • Better pivot selection reduces worst-case probability
  • Hybrid approach: switches to insertion sort for small arrays
  • Tail recursion optimization to reduce stack usage
Inheritance

Constructors

OptimizedQuickSort.new()
Creates an OptimizedQuickSort strategy instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
meta AlgoMetadata
Metadata describing this strategy's characteristics and requirements
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canApply(List<int> input, SelectorHint hint) bool
Fast check if this strategy can be applied to the given input and hint.
override
execute(List<int> input) List<int>
Execute the algorithm on the given input.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited