kennen:lib:nth_element
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | kennen:lib:nth_element [2020-06-16 16:44] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== nth_element() ====== | ||
+ | ''# | ||
+ | |||
+ | <code cpp> | ||
+ | void nth_element (Ran first, Ran nth, Ran last) | ||
+ | void nth_element (Ran first, Ran nth, Ran last, Binary comp) | ||
+ | void nth_element (Exec pol, Ran first, Ran nth, Ran last) | ||
+ | void nth_element (Exec pol, Ran first, Ran nth, Ran last, Binary comp) | ||
+ | |||
+ | Ran ranges:: | ||
+ | Ran ranges:: | ||
+ | </ | ||
+ | | ||
+ | dass das nte Element an der richtigen Position steht | ||
+ | und sich links davon nur kleinere, rechts davon nur größere Elementwerte befinden. | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | ==== Ergebnis ==== | ||
+ | Rückgabewert: | ||
+ | |||
+ | ==== Siehe auch ==== | ||
+ | [[partial_sort]], | ||
+ | [[partition]]. | ||
+ | |||
+ | ==== Beispiel ==== | ||
+ | <code cpp nth_element.cpp> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | std::string s = "ein Beispiel"; | ||
+ | |||
+ | std::cout << s << ' | ||
+ | << " | ||
+ | |||
+ | std:: | ||
+ | |||
+ | std::cout << s << ' | ||
+ | } | ||
+ | </ | ||
kennen/lib/nth_element.txt · Zuletzt geändert: 2020-06-16 16:44 von 127.0.0.1