Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
Peter Gerwinski
hp
Commits
0936d4f0
Commit
0936d4f0
authored
8 years ago
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
Übungsaufgabe 3 vom 16.1.2017: Erklärungen zur doppelt verketteten Liste
parent
a0fe192b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
20170116/hp-uebung-20170116.pdf
+0
-0
0 additions, 0 deletions
20170116/hp-uebung-20170116.pdf
20170116/hp-uebung-20170116.tex
+34
-1
34 additions, 1 deletion
20170116/hp-uebung-20170116.tex
with
34 additions
and
1 deletion
20170116/hp-uebung-20170116.pdf
+
0
−
0
View file @
0936d4f0
No preview for this file type
This diff is collapsed.
Click to expand it.
20170116/hp-uebung-20170116.tex
+
34
−
1
View file @
0936d4f0
...
...
@@ -26,6 +26,7 @@
\usepackage
{
enumerate
}
\usepackage
{
ifthen
}
\usepackage
{
gensymb
}
\usepackage
{
tikz
}
\newcounter
{
exercise
}
\newcommand
{
\exercise
}
[1]
{
\addtocounter
{
exercise
}{
1
}
\subsection*
{
Aufgabe
\arabic
{
exercise
}
: #1
}}
...
...
@@ -202,8 +203,40 @@
zum Löschen eines Elements aus der Liste
mit Freigabe des Speicherplatzes.
\points
{
3
}
\end{enumerate}
Eine doppelt verkettete Liste hat in jedem Knotenpunkt (
\lstinline
{
node
}
)
\emph
{
zwei
\/
}
Zeiger -- einen auf das nächste Element (
\lstinline
{
next
}
)
und einen auf das vorherige Element (z.
\,
B.
\ \lstinline
{
prev
}
für "`previous"').
Dadurch ist es leichter als bei einer einfach verketteten Liste,
die Liste in umgekehrter Reihenfolge durchzugehen.
\begin{quote}
\begin{tikzpicture}
\color
{
blendedblue
}
\node
(first) at (0,3.5)
{
first
}
;
\node
(NULL1) at (-1,1.25)
{
NULL
}
;
\node
[shape=rectangle,draw,line width=1pt]
(3) at (1,2)
{
3
}
;
\node
[shape=rectangle,draw,line width=1pt]
(7) at (3,2)
{
7
}
;
\node
[shape=rectangle,draw,line width=1pt]
(137) at (5,2)
{
137
}
;
\node
(NULL2) at (7,2.75)
{
NULL
}
;
\draw
[-latex]
(first)--(3);
\draw
[-latex]
(3) to[out=45,in=135] (7);
\draw
[-latex]
(3) to[out=-135,in=0] (NULL1);
\draw
[-latex]
(7) to[out=-135,in=-45] (3);
\draw
[-latex]
(7) to[out=45,in=135] (137);
\draw
[-latex]
(137) to[out=-135,in=-45] (7);
\draw
[-latex]
(137) to[out=45,in=180] (NULL2);
\end{tikzpicture}
\end{quote}
Der Rückwärts-Zeiger (
\lstinline
{
prev
}
) des ersten Elements zeigt,
genau wie der Vorwärts-Zeiger (
\lstinline
{
next
}
) des letzten Elements,
auf
\emph
{
nichts
}
, hat also den Wert
\lstinline
{
NULL
}
.
\begin{enumerate}
[
\quad
(a)]
\setcounter
{
enumi
}{
1
}
\item
Schreiben Sie d
iese
s Programm um für doppelt verkettete Listen.
Schreiben Sie d
a
s Programm um für doppelt verkettete Listen.
\points
{
5
}
\end{enumerate}
...
...
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