aboutsummaryrefslogtreecommitdiff
path: root/Practical1/report/implementation.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Practical1/report/implementation.tex')
-rw-r--r--Practical1/report/implementation.tex9
1 files changed, 5 insertions, 4 deletions
diff --git a/Practical1/report/implementation.tex b/Practical1/report/implementation.tex
index 5c6bbff..6df8932 100644
--- a/Practical1/report/implementation.tex
+++ b/Practical1/report/implementation.tex
@@ -3,7 +3,7 @@
A Java application accompanies this report. I have chosen for a simple implementation of a vertex:
-\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java}
+\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java}
class Node<T> implements Comparable<Node<T>> {
private final T content;
private final List<Node<T>> neighbours = new ArrayList<>();
@@ -39,7 +39,7 @@ The graph therefore has a stack of lists of nodes as a private member. Every ele
That gives us the signature of the \texttt{Graph} class:
-\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java}
+\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java}
class Graph<T> {
private final List<Node<T>> nodes;
private final Stack<List<Node<T>>> restorePoints = new Stack<>();
@@ -74,10 +74,11 @@ The \texttt{addNode} and \texttt{getNode} methods are simply wrappers for the \t
Using these two classes in the problem at hand turns out to be as simple as:
-\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java}
+\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java}
Graph graph = new Graph<Integer>();
int n_bins = readGraph(new Scanner(System.in), graph);
- System.out.println(graph.maximumIndependentSetSize() >= n_bins ? "possible" : "impossible");
+ int miss = graph.maximumIndependentSetSize();
+ System.out.println(miss >= n_bins ? "possible" : "impossible");
\end{minted}
A suitable implementation of \texttt{readGraph} is outside the scope of this report.