Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Datenstrukturen und Algorithm Skript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Unger, Florian Fedor Fridolin
Datenstrukturen und Algorithm Skript
Commits
cf282d67
Commit
cf282d67
authored
4 years ago
by
Florian Unger
Browse files
Options
Downloads
Patches
Plain Diff
adaptiv formalisiert
parent
98e8a809
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
205_Eigenschaften_von_Sortieralgorithmen.tex
+28
-1
28 additions, 1 deletion
205_Eigenschaften_von_Sortieralgorithmen.tex
with
28 additions
and
1 deletion
205_Eigenschaften_von_Sortieralgorithmen.tex
+
28
−
1
View file @
cf282d67
...
...
@@ -31,7 +31,34 @@ Gelegentlich wird auch Speicherverbrauch von $\mathcal{O}(\log n)$ noch als \emp
\subsection
{
Adaptivität
}
Als adaptiv bezeichnet man einen Sortieralgorithmus, der kürzere Laufzeiten hat, wenn Teile des Arrays bereits sortiert
sind. Insbesondere muss der best-case also in
$
\mathcal
{
O
}
(
n
)
$
liegen.
sind. Insbesondere muss der best-case also in
$
\mathcal
{
O
}
(
n
)
$
liegen. Diese Definition lässt sich mittels
Fehlstellungen präzisieren:
\begin{definition}
[Fehlstände und Fehlstandszahl]
Sei A eine geordnete Menge und sei
$
[
a
_
1
,
\dots
, a
_
n
]
\in
A
^
n
$
eine Folge von Elementen in A. Die Anzahl der
Fehlstände bezüglich
$
a
_
i
$
ist
\[
f
_
i :
=
|
\{
a
_
j : j > i, a
_
j < a
_
i
\}
|,
\]
also alle Elemente die rechts von
$
a
_
i
$
liegen, obwohl sie bei einer geordneten Folge links von
$
a
_
i
$
liegen sollten.
Die Summe aller Fehlstände einer solchen Folge ist die Fehlstandszahl
\[
F
([
a
_
1
,
\dots
, a
_
n
])
:
=
\sum
_{
i
=
1
}^
n f
_
i.
\]
\end{definition}
Die Fehlstandszahl ist
$
F
([
1
,
2
,
3
,
\dots
,n
])
=
0
$
, falls wir eine vollständig sortierte Folge haben, ist bei einer
einzelnen Vertauschung von zwei Nachbarn
$
1
$
und wir bei einem invers sortierten Array maximiert:
$
F
([
n,n
-
1
,
\dots
,
1
])
=
\sum
_{
i
=
1
}^{
n
-
1
}
i
=
\frac
{
n
^
2
-
n
}{
2
}$
.
Adaptiv im strengeren Sinne bedeutet nun, dass sich die (asymptotische) Laufzeit auch in Abhängigkeit zu den Fehlständen
ausdrücken lässt und geringer wird, wenn weniger Fehlstände vorliegen.
Allerdings wird adaptiv landläufig auch etwas lockerer gehandhabt und umschließt auch das Erkennen invers sortierter
Teilbereich ein. Diese stellen in unserer Definition aber gerade den maximal schlimmsten Fall dar.
TODO: Beispiel
\texttt
{
insertionsort
}
.
\subsection
{
Parallelisierbarkeit
}
Sowohl auf dem PC, als auch im Smartphone und inbesondere in einem Rechenzentrum wird zusätzliche Rechenleistung fast
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment