Moin,
Gesamtaufwand: n² * log(n)
Das ist so nicht richtig:
zuerst wird sortiert O(n*log(n))
und danach wird verglichen O(n),
also O(n + n*log(n))
----^----
was besser ist als O(n²) bezogen auf die Komplexität.
Gruß, Volker
--
„I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."
- Tony Hoare
„I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies."
- Tony Hoare