Cleanup and test suite bug fix master
authorJakob Cornell <jakob+gpg@jcornell.net>
Tue, 15 Dec 2020 06:37:40 +0000 (00:37 -0600)
committerJakob Cornell <jakob+gpg@jcornell.net>
Tue, 15 Dec 2020 06:37:40 +0000 (00:37 -0600)
doc.tex
impl/algorithms/dijkstra/java/Usage.java
impl/algorithms/hull-2d/java/Usage.java
impl/algorithms/hull-2d/java/makefile
latex/algorithms/hull-2d.tex
latex/structures/disjoint-sets.tex

diff --git a/doc.tex b/doc.tex
index 0f80d802eb239f28a0e9f354f35af727da59c0e3..62da2f484ff2d6786233341307d0d75be1d0b031 100644 (file)
--- a/doc.tex
+++ b/doc.tex
@@ -5,7 +5,6 @@
 \usepackage{parskip} % replaces paragraph indentation with vertical space
 \usepackage{float} % used for captions on code listings
 \usepackage{ifthen} % for conditional compilation
-\usepackage[toc,page]{appendix}
 \usepackage[bookmarks]{hyperref} % for PDF navigation features
 
 \newcommand{\ProjRootPrefix}{..}
@@ -46,8 +45,6 @@
        \input{\ProjRootPrefix/latex/algorithms/kruskals.tex}
 
        \RefBreak
-       \begin{appendix}
-               \section{Data Structures}
-               \input{\ProjRootPrefix/latex/structures/disjoint-sets.tex}
-       \end{appendix}
+       \section{Data Structures}
+       \input{\ProjRootPrefix/latex/structures/disjoint-sets.tex}
 \end{document}
index ebf88bb83efe5923cd1725e4ad1a117b7fd71456..bb0561d9c0a130a0d3ad5075e7943946c06e9411 100644 (file)
@@ -1,5 +1,3 @@
-import java.util.Collections;
-
 public class Usage {
        public static void main(String[] args) {
                Graph graph = new Graph();
index e045ee6808007ba3be293eb6baedd24416ce2e0d..2747357277f959f603b0acdef4b0cdd9ef0ea576 100644 (file)
@@ -1,21 +1,15 @@
-import java.util.*;
+Hull.Point a = new Hull.Point(0, 3);
+Hull.Point b = new Hull.Point(-2, 2);
+Hull.Point c = new Hull.Point(1, -6);
 
-public class Usage {
-       public static void main(String[] args) {
-               Hull.Point a = new Hull.Point(0, 3);
-               Hull.Point b = new Hull.Point(-2, 2);
-               Hull.Point c = new Hull.Point(1, -6);
+// construct a set of points for input
+Set<Hull.Point> points = new HashSet<>(Arrays.asList(new Hull.Point[] {a, b, c}));
+// or manually:
+Set<Hull.Point> points2 = new HashSet<>();
+points2.add(a);
+points2.add(b);
+points2.add(c);
 
-               // construct a set of points for input
-               Set<Hull.Point> points = new HashSet<>(Arrays.asList(new Hull.Point[] {a, b, c}));
-               // or manually:
-               Set<Hull.Point> points2 = new HashSet<>();
-               points2.add(a);
-               points2.add(b);
-               points2.add(c);
-
-               List<Hull.Point> out = Hull.hull(points);
-               System.out.println(out.get(0) == c);
-               System.out.println(out.contains(b));
-       }
-}
+List<Hull.Point> out = Hull.hull(points);
+System.out.println(out.get(0) == c);
+System.out.println(out.contains(b));
index e950b222e522a90f819c0d3251787c6ee9825c57..28a44a134f3367834a47b6220fed2d8aee9ce3e5 100644 (file)
@@ -7,4 +7,4 @@ test: output/Test.class
 
 output/Test.class: $(SOURCES)
        @mkdir -p output
-       javac -d output Test.java Usage.java
+       javac -d output Test.java
index 2f6f010eeb1d53d81a1c790e83e5ba7c78d394e0..8736989e3f014c9390ee467378286962bb23603b 100644 (file)
@@ -9,15 +9,6 @@
                The implementations here use a technique called Graham scan to compute the convex hull with time complexity $O(n \log n)$, where $n$ is the number of input points.
                The output points are ordered: the bottom-most (and then leftmost) point appears first, then the remaining hull points in counterclockwise order.
 
-               \TopicSubHeader{Java}
-
-                       \centerline{\texttt{Hull.java}}
-                       \inputminted{java}{\ThisImpl/java/Hull.java}
-
-                       This may be used as follows:
-
-                       \inputminted{java}{\ThisImpl/java/Usage.java}
-
                \TopicSubHeader{Python 3}
 
                        \inputminted{python}{\ThisImpl/python3/hull.py}
                        A sample usage:
 
                        \inputminted{python}{\ThisImpl/python3/usage.py}
+
+               \TopicSubHeader{Java}
+
+                       \centerline{\texttt{Hull.java}}
+                       \inputminted{java}{\ThisImpl/java/Hull.java}
+
+                       This may be used as follows:
+
+                       \inputminted{java}{\ThisImpl/java/Usage.java}
 }
index 768a125cb2fbbc95b3b1df63fb60d247a28558ee..80467c5f6fcc6eb0a6f7b2000c9bb1f5ab1e291d 100644 (file)
@@ -15,7 +15,7 @@
                        \inputminted{python}{\ThisImpl/python3/usage.py}
 
                        The values in the sets may be of any type, as long as they are hashable. The data
-                       structures uses hashing and equality testing to locate nodes. Generally, this means you
+                       structure uses hashing and equality testing to locate nodes. Generally, this means you
                        can safely use immutable built-in types or your own custom object types as values in the
                        sets.