Jump to content

Adaptive algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Storabled (talk | contribs) at 09:56, 5 June 2009 (adaptive algorithms are the best). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An adaptive algorithm is an algorithm which changes its behavior based on the resources available. Most of the best algorithms are adaptive.[citation needed] For example, stable partition, using no additional memory is O(n lg n) but given O(n) memory, it can be O(n) in time. As implemented by the C++ Standard Library, stable_partition is adaptive and so it acquires as much memory as it can get (up to what it would need at most) and applies the algorithm using that available memory. Another example is adaptive sort, whose behaviour changes upon the presortedness of its input.