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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cemal, Mevludin
Datenstrukturen und Algorithm Skript
Commits
34e3a1e4
Commit
34e3a1e4
authored
3 years ago
by
Florian Unger
Browse files
Options
Downloads
Patches
Plain Diff
Details und so
parent
d5e7e44d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
103_Elementare_Datenstrukturen.tex
+10
-9
10 additions, 9 deletions
103_Elementare_Datenstrukturen.tex
with
10 additions
and
9 deletions
103_Elementare_Datenstrukturen.tex
+
10
−
9
View file @
34e3a1e4
...
@@ -145,11 +145,12 @@ $\mathcal{O}(1)$ Aufwand vonnöten ist. \\
...
@@ -145,11 +145,12 @@ $\mathcal{O}(1)$ Aufwand vonnöten ist. \\
\begin{algorithm}
[H]
\begin{algorithm}
[H]
\SetNlSty
{
texttt
}{
[
}{
]
}
\SetNlSty
{
texttt
}{
[
}{
]
}
\caption
{
\texttt
{
insert
\textunderscore
after
}$
((
d,p
)
, d'
)
$}
\caption
{
\texttt
{
insert
\textunderscore
after
}$
((
d,p
)
, d'
)
$}
\KwIn
{
A node
$
(
d,p
)
$
to the list element after which to insert the new list element storing
$
d
$}
\KwIn
{
A node
$
(
d,p
)
$
to the list element after which to insert the new list element storing
$
d
'
$}
\KwOut
{
Side effects in the memory
$
\mathcal
{
M
}$}
\KwOut
{
Side effects in the memory
$
\mathcal
{
M
}$}
new
\_
element = (
$
d
$
,
\texttt
{
next
}
(
$
\mathcal
{
M
}$
[p]))
\;
new
\_
element
$
=
(
d'
,
\texttt
{
pointer
}
(
\texttt
{
next
}
((
d,p
))))
$
\;
\texttt
{
next
}
(
$
\mathcal
{
M
}
[
p
]
$
)
$
\leftarrow
$
\texttt
{
reference
\_
of
}
(new
\_
element)
\;
$
\texttt
{
next
}
(
\mathcal
{
M
}
[
p
])
\leftarrow
\texttt
{
reference
\_
of
}
(
new
\_
element
)
$
\;
\end{algorithm}
\end{algorithm}
Hier gibt
$
\texttt
{
reference
\_
of
}$
die Speicherposition des frisch erstellten Nodes zurück.
\begin{figure}
[!htb]
\begin{figure}
[!htb]
\centering
\centering
...
@@ -162,10 +163,10 @@ Auch für das Löschen ist nur das Umbiegen eines einzelnen Zeigers nötig, sieh
...
@@ -162,10 +163,10 @@ Auch für das Löschen ist nur das Umbiegen eines einzelnen Zeigers nötig, sieh
\begin{algorithm}
[H]
\begin{algorithm}
[H]
\SetNlSty
{
texttt
}{
[
}{
]
}
\SetNlSty
{
texttt
}{
[
}{
]
}
\caption
{
\texttt
{
delete
\textunderscore
after(
p
)
}}
\caption
{
\texttt
{
delete
\textunderscore
after(
(d,p)
)
}}
\KwIn
{
A
pointer
$
p
$
to the list element whose successor shall be removed from the list
}
\KwIn
{
A
node
$
(
d,p
)
$
to the list element whose successor shall be removed from the list
}
\KwOut
{
Side effects in the memory
$
\mathcal
{
M
}$}
\KwOut
{
Side effects in the memory
$
\mathcal
{
M
}$}
$
\texttt
{
next
}
(
\mathcal
{
M
}
[
p
]
)
\leftarrow
\texttt
{
next
}
(
\texttt
{
next
}
(
\mathcal
{
M
}
[
p
]
))
$
\;
$
((
d,p
)
)
\leftarrow
(
d,
\texttt
{
pointer
}
(
\texttt
{
next
}
(
(
d,p
))
))
$
\;
\end{algorithm}
\end{algorithm}
\begin{figure}
[!htb]
\begin{figure}
[!htb]
...
@@ -204,7 +205,7 @@ Allerdings kann eine doppelt verkettete Liste als die natürlichste Datenstruktu
...
@@ -204,7 +205,7 @@ Allerdings kann eine doppelt verkettete Liste als die natürlichste Datenstruktu
werden.
werden.
\subsection
{
Stack
}
\subsection
{
Stack
s
$
\mathcal
{
S
}$
}
Ein Stack
$
\mathcal
{
S
}$
ist wie ein Stapel Teller: Hinzufügen oder Entnehmen von weiteren Tellern ist nur an der Spitze möglich.
Ein Stack
$
\mathcal
{
S
}$
ist wie ein Stapel Teller: Hinzufügen oder Entnehmen von weiteren Tellern ist nur an der Spitze möglich.
Viele Anwendungen brauchen genau das, aber auch nicht mehr. Beispielsweise das Umdrehen der Reihenfolge einer Sequenz,
Viele Anwendungen brauchen genau das, aber auch nicht mehr. Beispielsweise das Umdrehen der Reihenfolge einer Sequenz,
...
@@ -248,7 +249,7 @@ Auslesen, und dem Löschen: \\
...
@@ -248,7 +249,7 @@ Auslesen, und dem Löschen: \\
Charmant für uns ist, dass alle Operationen auf Stacks jeweils
$
\mathcal
{
O
}
(
1
)
$
Zeit brauchen, meist also
Charmant für uns ist, dass alle Operationen auf Stacks jeweils
$
\mathcal
{
O
}
(
1
)
$
Zeit brauchen, meist also
vernachlässigbar sind.
vernachlässigbar sind.
\subsection
{
Queue
}
\subsection
{
Queue
s
$
\mathcal
{
Q
}$
}
Anders als der Stapel, der die LIFO-Strategie verfolgt, beschreibt die Queue eine (faire) Warteschlange: Wer als erstes
Anders als der Stapel, der die LIFO-Strategie verfolgt, beschreibt die Queue eine (faire) Warteschlange: Wer als erstes
da war, kommt als erstes dran. Man nennt es auch die FIFO-Strategie (first-in, first-out).
da war, kommt als erstes dran. Man nennt es auch die FIFO-Strategie (first-in, first-out).
Ansonsten hat auch sie zwei Funktion,
$
\texttt
{
put
}$
, das Hintanstellen, sowie
$
\texttt
{
get
}$
, das Drankommen.
Ansonsten hat auch sie zwei Funktion,
$
\texttt
{
put
}$
, das Hintanstellen, sowie
$
\texttt
{
get
}$
, das Drankommen.
...
...
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