if, for some given
input size, the running time of the algorithm is provably
better for inputs with low value of the measure. Perhaps
the most well-known measure is Inv, the number of
inversions (i.e. pairs of elements that are in the wrong
order) in the input. Other measures of presortedness
include Rem, the minimum number of elements that
must be removed for the remaining elements to be
sorted, and Runs, the number of consecutive ascending
runs. More examples of measures can be found in [5].
An example of an adaptive sorting algorithm is insertion
sort using level-linked B-trees with nger searches for
locating each new insertion point [13], which sorts in
O(n(1 + log(1 + Inv=n))) time. In the comparison
model, this is known to be optimal with respect to the
measure Inv [5].
if, for some giveninput size, the running time of the algorithm is provablybetter for inputs with low value of the measure. Perhapsthe most well-known measure is Inv, the number ofinversions (i.e. pairs of elements that are in the wrongorder) in the input. Other measures of presortednessinclude Rem, the minimum number of elements thatmust be removed for the remaining elements to besorted, and Runs, the number of consecutive ascendingruns. More examples of measures can be found in [5].An example of an adaptive sorting algorithm is insertionsort using level-linked B-trees with nger searches forlocating each new insertion point [13], which sorts inO(n(1 + log(1 + Inv=n))) time. In the comparisonmodel, this is known to be optimal with respect to themeasure Inv [5].
การแปล กรุณารอสักครู่..
