Jump to content

Adaptive algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Oxymoron83 (talk | contribs) at 02:02, 12 July 2007 (Reverted 1 edit by 129.97.83.233 identified as vandalism to last revision by Caerwine. using TW). 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. 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.