Thread Komplexität von Algorithmen: Komplexität der Form O(N)
(29 answers)
Opened by [E|B] at 2004-07-28 15:51
Ganz genau:
Wen ein Algorithmus die Komplexität O(f(n)) hat, dann gibt es eine Konstante c, so dass für alle n gilt: Die Laufzeit ist kleinergleich c * f(n) (* konstanter Zeitverbrauch). Wichtig ist, dass es ein und dieselbe Konstante c für alle n ist. Manchmal kann für kleine n ein Algorithmus mit quadratischer Komplexität (also O(n^2)) trotzdem schneller sein als einer mit O(n log n) s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;
use strict; use warnings; Link zu meiner Perlseite |