diff options
author | Camil Staps | 2015-11-02 15:49:23 +0100 |
---|---|---|
committer | Camil Staps | 2015-11-02 15:49:23 +0100 |
commit | e4ee1f8a1e5707a4d8478a678a03ce664ae8f894 (patch) | |
tree | 7a3f3d49c54d888f7ded3e2dafb3ec03ee6f3672 /Practical1/report/implementation.tex | |
parent | P1 report: typo; margins; copyright; lemmas / proofs on one page (diff) |
Working on report
Diffstat (limited to 'Practical1/report/implementation.tex')
-rw-r--r-- | Practical1/report/implementation.tex | 9 |
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. |