Some little refactoring on 3.1.2
This commit is contained in:
parent
7226588af3
commit
db6e70ebaf
2 changed files with 3 additions and 2 deletions
|
|
@ -69,8 +69,8 @@ public abstract class GraphAlgorithm<T> {
|
||||||
if (availableNodes.isEmpty()) {
|
if (availableNodes.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator<Node<T>> iter = availableNodes.iterator();
|
Iterator<Node<T>> iter = availableNodes.iterator();
|
||||||
Iterator<Node<T>> iterMinElem = iter;
|
|
||||||
AlgorithmNode<T> MinElem;
|
AlgorithmNode<T> MinElem;
|
||||||
AlgorithmNode<T> tempElem;
|
AlgorithmNode<T> tempElem;
|
||||||
|
|
||||||
|
|
@ -79,7 +79,6 @@ public abstract class GraphAlgorithm<T> {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
tempElem = algorithmNodes.get(iter.next());
|
tempElem = algorithmNodes.get(iter.next());
|
||||||
if (tempElem.value < MinElem.value) {
|
if (tempElem.value < MinElem.value) {
|
||||||
iterMinElem = iter;
|
|
||||||
MinElem = tempElem;
|
MinElem = tempElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,8 @@
|
||||||
\subsection{Wege finden}
|
\subsection{Wege finden}
|
||||||
\subsubsection{Teil (a)}
|
\subsubsection{Teil (a)}
|
||||||
|
|
||||||
|
$O(n) = $
|
||||||
|
|
||||||
\subsubsection{Teil (b)}
|
\subsubsection{Teil (b)}
|
||||||
|
|
||||||
\subsubsection{Teil (c)}
|
\subsubsection{Teil (c)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue