Looking for Course 42936 test answers and solutions? Browse our comprehensive collection of verified answers for Course 42936 at moodle.jku.at.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Gegeben ist folgender Sortieralgorithmus:
void sort(int list[]) { int n = list.length; for (int i = 0; i < n - 1; i++) for (int j = 0; j < n - i - 1; j++) if (list[j] > list[j + 1]) swap(list[j], list[j + 1]);
}Wie viele Vertauschungen von Listenelementen (Operation: swap) gibt es im ungünstigsten Fall?
Welche asymptotische Laufzeitkomplexität ergibt sich dadurch?