From 724ef3c7daa90e8868110041e153c4e77aa5937d Mon Sep 17 00:00:00 2001 From: SungminKim Date: Mon, 20 Nov 2017 15:18:08 +0900 Subject: [PATCH 01/30] Modified Dijkstra test typo --- test/com/jwetherell/algorithms/graph/test/Graphs.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/com/jwetherell/algorithms/graph/test/Graphs.java b/test/com/jwetherell/algorithms/graph/test/Graphs.java index e63e5602..1908497a 100644 --- a/test/com/jwetherell/algorithms/graph/test/Graphs.java +++ b/test/com/jwetherell/algorithms/graph/test/Graphs.java @@ -372,13 +372,13 @@ public void testDijstraUndirected() { for (Graph.Vertex v : map1.keySet()) { final Graph.CostPathPair path1 = map1.get(v); final Graph.CostPathPair path2 = getIdealUndirectedPath(undirected).get(v); - assertTrue("Dijstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2)); + assertTrue("Dijkstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2)); } final Graph.CostPathPair pair1 = Dijkstra.getShortestPath(undirected.graph, start, end); assertTrue("No path from " + start.getValue() + " to " + end.getValue(), (pair1 != null)); - assertTrue("Dijstra's shortest path error. pair="+pair1+" pair="+getIdealUndirectedPathPair(undirected), pair1.equals(getIdealUndirectedPathPair(undirected))); + assertTrue("Dijkstra's shortest path error. pair="+pair1+" pair="+getIdealUndirectedPathPair(undirected), pair1.equals(getIdealUndirectedPathPair(undirected))); } } From d428afeffd5edc58134b7409dc3acba3fd663237 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:21:27 +0900 Subject: [PATCH 02/30] Fixed Param of Comment --- src/com/jwetherell/algorithms/data_structures/BTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BTree.java b/src/com/jwetherell/algorithms/data_structures/BTree.java index d15d398c..d930076b 100644 --- a/src/com/jwetherell/algorithms/data_structures/BTree.java +++ b/src/com/jwetherell/algorithms/data_structures/BTree.java @@ -109,7 +109,7 @@ public boolean add(T value) { /** * The node's key size is greater than maxKeySize, split down the middle. * - * @param node + * @param nodeToSplit * to split. */ private void split(Node nodeToSplit) { From 6596bbe775a316cbb489837d6c2ebd6ae739f566 Mon Sep 17 00:00:00 2001 From: SungminKim Date: Mon, 20 Nov 2017 15:24:23 +0900 Subject: [PATCH 03/30] Fixed Dijkstra test typo --- test/com/jwetherell/algorithms/graph/test/Graphs.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/com/jwetherell/algorithms/graph/test/Graphs.java b/test/com/jwetherell/algorithms/graph/test/Graphs.java index 1908497a..6a17dcd0 100644 --- a/test/com/jwetherell/algorithms/graph/test/Graphs.java +++ b/test/com/jwetherell/algorithms/graph/test/Graphs.java @@ -361,7 +361,7 @@ private Graph.CostPathPair getIdealDirectedWithNegWeightsPathPair(Direc } @Test - public void testDijstraUndirected() { + public void testDijkstraUndirected() { final UndirectedGraph undirected = new UndirectedGraph(); final Graph.Vertex start = undirected.v1; final Graph.Vertex end = undirected.v5; @@ -546,14 +546,14 @@ public void testDijkstraDirected() { for (Graph.Vertex v : map1.keySet()) { final Graph.CostPathPair path1 = map1.get(v); final Graph.CostPathPair path2 = getIdealDirectedPath(directed).get(v); - assertTrue("Dijstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2)); + assertTrue("Dijkstra's shortest path error. path1="+path1+" path2="+path2, path1.equals(path2)); } final Graph.CostPathPair pair1 = Dijkstra.getShortestPath(directed.graph, start, end); assertTrue("No path from "+start.getValue()+" to "+end.getValue(), (pair1!=null)); // Compare pair - assertTrue("Dijstra's shortest path error. pair1="+pair1+" idealPathPair="+getIdealPathPair(directed), pair1.equals(getIdealPathPair(directed))); + assertTrue("Dijkstra's shortest path error. pair1="+pair1+" idealPathPair="+getIdealPathPair(directed), pair1.equals(getIdealPathPair(directed))); } @Test @@ -579,7 +579,7 @@ public void testBellmanFordDirected() { } @Test - public void testDijstraDirectedWihtNegativeWeights() { + public void testDijkstraDirectedWihtNegativeWeights() { final DirectedWithNegativeWeights directedWithNegWeights = new DirectedWithNegativeWeights(); { // DIRECTED GRAPH (WITH NEGATIVE WEIGHTS) final Graph.Vertex start = directedWithNegWeights.v1; From 3126082cae851e3a685fc315947f2af033c89444 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:50:11 +0900 Subject: [PATCH 04/30] Fixed param of Comment in getDirenctions --- src/com/jwetherell/algorithms/data_structures/BinaryHeap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index 61f38a16..1b876f36 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -449,8 +449,8 @@ public int size() { /** * Get the navigation directions through the tree to the index. * - * @param index - * of the Node to get directions for. + * @param idx + * index of the Node to get directions for. * @return Integer array representing the directions to the index. */ private static int[] getDirections(int idx) { From 5dc01d3cbe888b9257d34e33daa1c179bec159b6 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:50:43 +0900 Subject: [PATCH 05/30] Fixed param of Comment in validateNode --- src/com/jwetherell/algorithms/data_structures/BinaryHeap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index 1b876f36..81932349 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -289,8 +289,8 @@ public boolean validate() { /** * Validate the node for the heap invariants. * - * @param node - * to validate for. + * @param index + * of node to validate for. * @return True if node is valid. */ private boolean validateNode(int index) { From ed54292376c43ca30243407f37604d665de0bd94 Mon Sep 17 00:00:00 2001 From: SungminKim Date: Mon, 20 Nov 2017 16:03:47 +0900 Subject: [PATCH 06/30] Fix incorrected spelling --- src/com/jwetherell/algorithms/numbers/Integers.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/numbers/Integers.java b/src/com/jwetherell/algorithms/numbers/Integers.java index 963f585e..fb86fd3d 100644 --- a/src/com/jwetherell/algorithms/numbers/Integers.java +++ b/src/com/jwetherell/algorithms/numbers/Integers.java @@ -129,12 +129,12 @@ public static final boolean powerOfTwoUsingBits(int numberToCheck) { multiDigits.put(10,"ten"); multiDigits.put(20,"twenty"); multiDigits.put(30,"thirty"); - multiDigits.put(40,"fourty"); + multiDigits.put(40,"forty"); multiDigits.put(50,"fifty"); multiDigits.put(60,"sixty"); multiDigits.put(70,"seventy"); multiDigits.put(80,"eighty"); - multiDigits.put(90,"ninty"); + multiDigits.put(90,"ninety"); } private static final int BILLION = 1000000000; From c38908c3151c24ea2eacf04dec80ac7e09a90e84 Mon Sep 17 00:00:00 2001 From: SungminKim Date: Mon, 20 Nov 2017 16:04:40 +0900 Subject: [PATCH 07/30] Fix incorrected spelling --- test/com/jwetherell/algorithms/numbers/test/Numbers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/com/jwetherell/algorithms/numbers/test/Numbers.java b/test/com/jwetherell/algorithms/numbers/test/Numbers.java index dfe714cd..dcf087ab 100644 --- a/test/com/jwetherell/algorithms/numbers/test/Numbers.java +++ b/test/com/jwetherell/algorithms/numbers/test/Numbers.java @@ -91,17 +91,17 @@ public void testToEnglish() { assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english))); a = 199; - check = "one-hundred ninty-nine"; + check = "one-hundred ninety-nine"; english = Integers.toEnglish(a); assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english))); a = Integer.MAX_VALUE; // 2,147,483,647 - check = "two-billion one-hundred fourty-seven-million four-hundred eighty-three-thousand six-hundred fourty-seven"; + check = "two-billion one-hundred forty-seven-million four-hundred eighty-three-thousand six-hundred forty-seven"; english = Integers.toEnglish(a); assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english))); a = Integer.MIN_VALUE+1; // -2,147,483,647 - check = "negative two-billion one-hundred fourty-seven-million four-hundred eighty-three-thousand six-hundred fourty-seven"; + check = "negative two-billion one-hundred forty-seven-million four-hundred eighty-three-thousand six-hundred forty-seven"; english = Integers.toEnglish(a); assertTrue("toEnglish error. a="+a+" expected="+check+" got="+english, (check.equals(english))); } From 616213e71c4b8416764a6f32cda9396c85c2f5b0 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 16:17:53 +0900 Subject: [PATCH 08/30] Test unused Method --- .../data_structures/CompactSuffixTrie.java | 5 +++++ .../test/CompactSuffixTrieTests.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java b/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java index bc64b598..b2796543 100644 --- a/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java +++ b/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java @@ -141,4 +141,9 @@ private Set getSuffixes(PatriciaTrie.Node node, String prefix) { public String toString() { return PatriciaTrie.PatriciaTriePrinter.getString(tree); } + + public boolean equals(CompactSuffixTrie trie){ + if(this.getSuffixes().equals(trie.getSuffixes())) return true; + return false; + } } diff --git a/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java b/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java index 8b6bce27..f32f3f64 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java @@ -25,4 +25,26 @@ public void testCompactSuffixTrie() { exists = trie.doesSubStringExist(pass); assertTrue("YIKES!! " + pass + " doesn't exists.", exists); } + + @Test + public void testCompactSuffixTrie_equals() { + String bookkeeper = "bookkeeper"; + CompactSuffixTrie trie = new CompactSuffixTrie(bookkeeper); + + String bookkeeper_1 = "bookkeeper"; + CompactSuffixTrie trie_1 = new CompactSuffixTrie(bookkeeper_1); + + boolean equal = trie.equals(trie_1); + assertTrue("YIKES!! " + bookkeeper + " and " + bookkeeper_1 + " are not equal.", equal); + + + String failed = "failed"; + trie = new CompactSuffixTrie(failed); + + String failed_1 = "failet"; + trie_1 = new CompactSuffixTrie(failed_1); + + equal = trie.equals(trie_1); + assertFalse("YIKES!! " + failed + " and " + failed_1 + " are equal.", equal); + } } From aac1f8b1a704140283e8ca99f762aa5b1d3c95b4 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:29:45 +0900 Subject: [PATCH 09/30] Fixed Param comment --- src/com/jwetherell/algorithms/data_structures/HashMap.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/HashMap.java b/src/com/jwetherell/algorithms/data_structures/HashMap.java index 76c669de..6556d4b9 100644 --- a/src/com/jwetherell/algorithms/data_structures/HashMap.java +++ b/src/com/jwetherell/algorithms/data_structures/HashMap.java @@ -212,9 +212,6 @@ private void initializeMap(int length) { * * @param h * hash to get index of. - * @param length - * length of array - * * @return Integer which represents the key. */ private int indexOf(int h) { From ac23dab6c7d6663808d28e2fc920d43cbe02da5d Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:34:11 +0900 Subject: [PATCH 10/30] Fixed Param comment in InterverTree --- .../algorithms/data_structures/IntervalTree.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/IntervalTree.java b/src/com/jwetherell/algorithms/data_structures/IntervalTree.java index a04113ba..1a82ef30 100644 --- a/src/com/jwetherell/algorithms/data_structures/IntervalTree.java +++ b/src/com/jwetherell/algorithms/data_structures/IntervalTree.java @@ -314,7 +314,7 @@ public IntervalData(long start, long end, O object) { /** * Interval data list which should all be unique * - * @param list + * @param set * of interval data objects */ public IntervalData(long start, long end, Set set) { @@ -389,10 +389,9 @@ public IntervalData copy() { /** * Query inside this data object. * - * @param start - * of range to query for. - * @param end - * of range to query for. + * @param index + * to find Data. + * * @return Data queried for or NULL if it doesn't match the query. */ public IntervalData query(long index) { From b85ef7e0cb69af9ce2e8673594a6c087ac895929 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:38:43 +0900 Subject: [PATCH 11/30] Fixed Param comment in SegmentTree --- src/com/jwetherell/algorithms/data_structures/SegmentTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/SegmentTree.java b/src/com/jwetherell/algorithms/data_structures/SegmentTree.java index 9a04b8e6..fb516d8e 100644 --- a/src/com/jwetherell/algorithms/data_structures/SegmentTree.java +++ b/src/com/jwetherell/algorithms/data_structures/SegmentTree.java @@ -696,7 +696,7 @@ public IntervalData(long start, long end, O object) { /** * Interval data list which should all be unique * - * @param list + * @param set * of interval data objects */ public IntervalData(long start, long end, Set set) { From 5033342d1c679beb35ece62592b80cb4c66df59a Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:45:53 +0900 Subject: [PATCH 12/30] Fixed Param comment in ConnectedComponents --- src/com/jwetherell/algorithms/graph/ConnectedComponents.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/graph/ConnectedComponents.java b/src/com/jwetherell/algorithms/graph/ConnectedComponents.java index dae44174..e096950c 100644 --- a/src/com/jwetherell/algorithms/graph/ConnectedComponents.java +++ b/src/com/jwetherell/algorithms/graph/ConnectedComponents.java @@ -25,7 +25,8 @@ private ConnectedComponents() { } /** * Finds the connected components subsets of the Graph. * - * @param g Graph to find connected components. + * @param graph + * to find connected components. * @return List of connected components in the Graph. */ public static final > List>> getConnectedComponents(Graph graph) { From 2b0a3b03a8d13ac06532c3a803ec08286eaa8bb6 Mon Sep 17 00:00:00 2001 From: aniders <33834501+aniders@users.noreply.github.com> Date: Wed, 14 Feb 2018 23:45:39 +0530 Subject: [PATCH 13/30] Update Knapsack.java Changed OR condition to &&, OR may possibly result in ArrayIndexOutOfBoundException , (as it does for following input capacity : 60, weights: [10, 20, 33], values: [10, 3, 30]) --- src/com/jwetherell/algorithms/mathematics/Knapsack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/mathematics/Knapsack.java b/src/com/jwetherell/algorithms/mathematics/Knapsack.java index 69f848c2..09079ce9 100644 --- a/src/com/jwetherell/algorithms/mathematics/Knapsack.java +++ b/src/com/jwetherell/algorithms/mathematics/Knapsack.java @@ -40,7 +40,7 @@ public static final int[] zeroOneKnapsack(int[] values, int[] weights, int capac final List list = new ArrayList(); int i = height - 1; int j = width - 1; - while (i != 0 || j != 0) { + while (i != 0 && j != 0) { int current = output[i][j]; int above = output[i - 1][j]; if (current == above) { From 7a7549d8dfbd2653839c8f39fc8eaca95f38ee2e Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 3 May 2018 10:18:30 -0400 Subject: [PATCH 14/30] Closes #91 Bug fix --- .../LongestIncreasingSubsequence.java | 50 +++++++++++++------ .../algorithms/sequence/test/Sequences.java | 2 +- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/com/jwetherell/algorithms/sequence/LongestIncreasingSubsequence.java b/src/com/jwetherell/algorithms/sequence/LongestIncreasingSubsequence.java index 4421896b..598f6885 100644 --- a/src/com/jwetherell/algorithms/sequence/LongestIncreasingSubsequence.java +++ b/src/com/jwetherell/algorithms/sequence/LongestIncreasingSubsequence.java @@ -1,9 +1,5 @@ package com.jwetherell.algorithms.sequence; -import com.jwetherell.algorithms.search.LowerBound; - -import java.util.Arrays; - /** * In computer science, the longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to highest, and in * which the subsequence is as long as possible. This subsequence is not necessarily contiguous, or unique. @@ -20,19 +16,43 @@ private LongestIncreasingSubsequence() { } /** * Longest increasing subsequence solved using dynamic programming. */ - public static int[] getLongestIncreasingSubsequence(int[] sequence) { - final int[] resultSequence = new int[sequence.length]; + public static int[] getLongestIncreasingSubsequence(int[] X) { + final int[] P = new int[X.length]; + final int[] M = new int[X.length+1]; + int L = 0; + for (int i=0; i L) { + // If we found a subsequence longer than any we've found yet, update L + L = newL; + } + } - int resultLength = 0; - for (int i = 0; i < sequence.length; ++i) { - // try to find the best place for new element in sorted result - final int pos = LowerBound.lowerBound(resultSequence, resultLength, sequence[i]); //O(log n) - // if the best place is at the end increase result length - if (pos >= resultLength) - resultLength++; - resultSequence[pos] = sequence[i]; + // Reconstruct the longest increasing subsequence + final int[] S = new int[L]; + int k = M[L]; + for (int i=L-1; i>=0; i--) { + S[i] = X[k]; + k = P[k]; } - return Arrays.copyOfRange(resultSequence, 0, resultLength); + return S; } } diff --git a/test/com/jwetherell/algorithms/sequence/test/Sequences.java b/test/com/jwetherell/algorithms/sequence/test/Sequences.java index 18b7d0c1..bd3fa1d8 100644 --- a/test/com/jwetherell/algorithms/sequence/test/Sequences.java +++ b/test/com/jwetherell/algorithms/sequence/test/Sequences.java @@ -141,7 +141,7 @@ public void testLongestIncreasingSubsequence() { sequencesLis.add(new int[]{1, 2, 3}); sequences.add(new int[]{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}); - sequencesLis.add(new int[]{0, 1, 3, 7, 11, 15}); + sequencesLis.add(new int[]{0, 2, 6, 9, 11, 15}); assertTrue("Longest increasing subsequence error. Sequences size=" + sequences.size() + " SequencesList size:" + sequencesLis.size(), sequences.size() == sequencesLis.size()); From 4c8e4c42f04f1d8b827dd7196e6e0f28a5091960 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 09:21:34 -0500 Subject: [PATCH 15/30] Updates to yaml to get jdk6 working in travis-ci --- .travis.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e2324a51..3c8d4d3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,15 @@ addons: - openjdk-6-jdk language: java +dist: trusty + +# for gh-1388 (workaround for supporting test using OpenJDK 6) +matrix: + include: + - env: JDK='OpenJDK 6' + before_install: + - echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc + - TRAVIS_JDK_VERSION=openjdk6 jdk: - oraclejdk9 @@ -22,7 +31,7 @@ jdk: # - openjdk9 - openjdk8 - openjdk7 - - openjdk6 +# - openjdk6 env: - TEST_SUITE=run_tests From 62e9f1dceb95faae646826377e569dbf7ba9f25d Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 09:31:26 -0500 Subject: [PATCH 16/30] Updates to yaml to get jdk6 working in travis-ci --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3c8d4d3f..f34c197c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,9 @@ dist: trusty # for gh-1388 (workaround for supporting test using OpenJDK 6) matrix: include: - - env: JDK='OpenJDK 6' + env: + - JDK='OpenJDK 6' + - TEST_SUITE=run_tests before_install: - echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc - TRAVIS_JDK_VERSION=openjdk6 From f0639aa08edeca4781714538d027eeb51d8e4735 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 09:50:48 -0500 Subject: [PATCH 17/30] Dropping builds for jdk6 because travis-ci no longer supports --- .travis.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index f34c197c..40a330e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,23 +6,7 @@ before_script: - echo $JAVA_OPTS - echo $ANT_OPTS -addons: - apt: - packages: - - openjdk-6-jdk - language: java -dist: trusty - -# for gh-1388 (workaround for supporting test using OpenJDK 6) -matrix: - include: - env: - - JDK='OpenJDK 6' - - TEST_SUITE=run_tests - before_install: - - echo "MAVEN_OPTS='-Dlicense.skip=true'" > ~/.mavenrc - - TRAVIS_JDK_VERSION=openjdk6 jdk: - oraclejdk9 From e5966440895ebed5d9a448ad9785db090b99c2e5 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 10:26:09 -0500 Subject: [PATCH 18/30] Fixed the Queue grow method comment about resizing --- src/com/jwetherell/algorithms/data_structures/Queue.java | 2 +- .../jwetherell/algorithms/data_structures/test/QueueTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/Queue.java b/src/com/jwetherell/algorithms/data_structures/Queue.java index 1a078f71..845e65e5 100644 --- a/src/com/jwetherell/algorithms/data_structures/Queue.java +++ b/src/com/jwetherell/algorithms/data_structures/Queue.java @@ -111,7 +111,7 @@ private boolean remove(int index) { return true; } - // Grow the array by 50% and rearrange to make sequential + // Triple the size of the underlying array and rearrange to make sequential private void grow(int size) { int growSize = (size + (size<<1)); T[] temp = (T[]) new Object[growSize]; diff --git a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java index b4512e57..153efc46 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java @@ -16,7 +16,7 @@ public class QueueTests { @Test public void testArrayQueue() { - TestData data = Utils.generateTestData(100); + TestData data = Utils.generateTestData(100000); String aName = "Queue [array]"; Queue.ArrayQueue aQueue = new Queue.ArrayQueue(); From cdafbb9471fd2876b0df7657be4d18a43d8a7110 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 11:17:36 -0500 Subject: [PATCH 19/30] Found a bug in the grow method of the ArrayQueue --- .../jwetherell/algorithms/data_structures/Queue.java | 10 +++++----- .../algorithms/data_structures/test/QueueTests.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/Queue.java b/src/com/jwetherell/algorithms/data_structures/Queue.java index 845e65e5..4aa200b7 100644 --- a/src/com/jwetherell/algorithms/data_structures/Queue.java +++ b/src/com/jwetherell/algorithms/data_structures/Queue.java @@ -117,11 +117,11 @@ private void grow(int size) { T[] temp = (T[]) new Object[growSize]; // Since the array can wrap around, make sure you grab the first chunk int adjLast = lastIndex % array.length; - if (adjLast < firstIndex) { - System.arraycopy(array, 0, temp, array.length-adjLast, adjLast+1); + if (adjLast > 0 && adjLast <= firstIndex) { + System.arraycopy(array, 0, temp, array.length-adjLast, adjLast); } // Copy the remaining - System.arraycopy(array, firstIndex, temp, 0, array.length-firstIndex); + System.arraycopy(array, firstIndex, temp, 0, array.length - firstIndex); array = null; array = temp; lastIndex = (lastIndex - firstIndex); @@ -134,9 +134,9 @@ private void shrink() { T[] temp = (T[]) new Object[shrinkSize]; // Since the array can wrap around, make sure you grab the first chunk int adjLast = lastIndex % array.length; - int endIndex = (lastIndex>array.length)?array.length:lastIndex; + int endIndex = (lastIndex>array.length) ? array.length : lastIndex; if (adjLast <= firstIndex) { - System.arraycopy(array, 0, temp, array.length-firstIndex, adjLast); + System.arraycopy(array, 0, temp, array.length - firstIndex, adjLast); } // Copy the remaining System.arraycopy(array, firstIndex, temp, 0, endIndex-firstIndex); diff --git a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java index 153efc46..9dfb6759 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java @@ -16,7 +16,7 @@ public class QueueTests { @Test public void testArrayQueue() { - TestData data = Utils.generateTestData(100000); + TestData data = Utils.generateTestData(2500); String aName = "Queue [array]"; Queue.ArrayQueue aQueue = new Queue.ArrayQueue(); @@ -30,7 +30,7 @@ public void testArrayQueue() { @Test public void testLinkedQueue() { - TestData data = Utils.generateTestData(100); + TestData data = Utils.generateTestData(250); String lName = "Queue [linked]"; Queue.LinkedQueue lQueue = new Queue.LinkedQueue(); From b98248222b875c56c8caf69eec44574ee05dd1ce Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 11:29:19 -0500 Subject: [PATCH 20/30] Fixed a bug in the getHeadValue of the Heap structures --- .../data_structures/BinaryHeap.java | 2 +- .../data_structures/test/BinaryHeapTests.java | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index 81932349..ac2ae1f9 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -341,7 +341,7 @@ public T[] getHeap() { */ @Override public T getHeadValue() { - if (array.length == 0) return null; + if (size == 0 || array.length == 0) return null; return array[0]; } diff --git a/test/com/jwetherell/algorithms/data_structures/test/BinaryHeapTests.java b/test/com/jwetherell/algorithms/data_structures/test/BinaryHeapTests.java index 865c266b..68591215 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/BinaryHeapTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/BinaryHeapTests.java @@ -1,6 +1,7 @@ package com.jwetherell.algorithms.data_structures.test; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertNull; import java.util.Collection; @@ -16,7 +17,7 @@ public class BinaryHeapTests { @Test public void testMinHeap() { - TestData data = Utils.generateTestData(100); + TestData data = Utils.generateTestData(2500); String aNameMin = "Min-Heap [array]"; BinaryHeap.BinaryHeapArray aHeapMin = new BinaryHeap.BinaryHeapArray(BinaryHeap.Type.MIN); @@ -26,6 +27,12 @@ public void testMinHeap() { assertTrue(JavaCollectionTest.testCollection(aCollectionMin, Integer.class, aNameMin, data.unsorted, data.sorted, data.invalid)); + BinaryHeap.BinaryHeapArray aHeapNull = new BinaryHeap.BinaryHeapArray(BinaryHeap.Type.MIN); + aHeapNull.add(10); + aHeapNull.add(11); + aHeapNull.clear(); + assertNull(aHeapNull.getHeadValue()); // we expect null here + String tNameMin = "Min-Heap [tree]"; BinaryHeap.BinaryHeapTree tHeapMin = new BinaryHeap.BinaryHeapTree(BinaryHeap.Type.MIN); Collection tCollectionMin = tHeapMin.toCollection(); @@ -33,11 +40,18 @@ public void testMinHeap() { data.unsorted, data.sorted, data.invalid)); assertTrue(JavaCollectionTest.testCollection(tCollectionMin, Integer.class, tNameMin, data.unsorted, data.sorted, data.invalid)); + + BinaryHeap.BinaryHeapTree tHeapNull = new BinaryHeap.BinaryHeapTree(BinaryHeap.Type.MIN); + tHeapNull.add(10); + tHeapNull.add(11); + tHeapNull.clear(); + assertNull(tHeapNull.getHeadValue()); // we expect null here + } @Test public void testMaxHeap() { - TestData data = Utils.generateTestData(1000); + TestData data = Utils.generateTestData(2500); String aNameMax = "Max-Heap [array]"; BinaryHeap.BinaryHeapArray aHeapMax = new BinaryHeap.BinaryHeapArray(BinaryHeap.Type.MAX); @@ -47,6 +61,12 @@ public void testMaxHeap() { assertTrue(JavaCollectionTest.testCollection(aCollectionMax, Integer.class, aNameMax, data.unsorted, data.sorted, data.invalid)); + BinaryHeap.BinaryHeapArray aHeapNull = new BinaryHeap.BinaryHeapArray(BinaryHeap.Type.MAX); + aHeapNull.add(10); + aHeapNull.add(11); + aHeapNull.clear(); + assertNull(aHeapNull.getHeadValue()); // we expect null here + String lNameMax = "Max-Heap [tree]"; BinaryHeap.BinaryHeapTree tHeapMax = new BinaryHeap.BinaryHeapTree(BinaryHeap.Type.MAX); Collection tCollectionMax = tHeapMax.toCollection(); @@ -54,5 +74,11 @@ public void testMaxHeap() { data.unsorted, data.sorted, data.invalid)); assertTrue(JavaCollectionTest.testCollection(tCollectionMax, Integer.class, lNameMax, data.unsorted, data.sorted, data.invalid)); + + BinaryHeap.BinaryHeapTree tHeapNull = new BinaryHeap.BinaryHeapTree(BinaryHeap.Type.MAX); + tHeapNull.add(10); + tHeapNull.add(11); + tHeapNull.clear(); + assertNull(tHeapNull.getHeadValue()); // we expect null here } } From edf84c527578997bc5e409f4166dd68c17d05790 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 12:11:39 -0500 Subject: [PATCH 21/30] Fixed a bug in the ArrayQueue iterator --- .../algorithms/data_structures/Queue.java | 2 +- .../data_structures/test/QueueTests.java | 22 +++++++++++++++++++ .../test/common/JavaCollectionTest.java | 6 +++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/Queue.java b/src/com/jwetherell/algorithms/data_structures/Queue.java index 4aa200b7..92962a4d 100644 --- a/src/com/jwetherell/algorithms/data_structures/Queue.java +++ b/src/com/jwetherell/algorithms/data_structures/Queue.java @@ -563,7 +563,7 @@ public boolean hasNext() { public T next() { if (queue.firstIndex+index < queue.lastIndex) { last = queue.firstIndex+index; - return queue.array[queue.firstIndex+index++]; + return queue.array[(queue.firstIndex + index++) % queue.array.length]; } return null; } diff --git a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java index 9dfb6759..6f2be148 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/QueueTests.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertTrue; import java.util.Collection; +import java.util.Iterator; import org.junit.Test; @@ -26,6 +27,17 @@ public void testArrayQueue() { data.unsorted, data.invalid)); assertTrue(JavaCollectionTest.testCollection(aCollection, Integer.class, aName, data.unsorted, data.sorted, data.invalid)); + + // Specific test based on bug + aQueue = new Queue.ArrayQueue(); + for (int i = 0; i < 1024; i++) { + aQueue.offer(i); + } + aQueue.poll(); + aQueue.offer(1024); + Iterator it = aQueue.toQueue().iterator(); + while (it.hasNext()) + it.next(); } @Test @@ -40,5 +52,15 @@ public void testLinkedQueue() { data.unsorted, data.invalid)); assertTrue(JavaCollectionTest.testCollection(lCollection, Integer.class, lName, data.unsorted, data.sorted, data.invalid)); + + lQueue = new Queue.LinkedQueue(); + for (int i = 0; i < 1024; i++) { + lQueue.offer(i); + } + lQueue.poll(); + lQueue.offer(1024); + Iterator it = lQueue.toQueue().iterator(); + while (it.hasNext()) + it.next(); } } diff --git a/test/com/jwetherell/algorithms/data_structures/test/common/JavaCollectionTest.java b/test/com/jwetherell/algorithms/data_structures/test/common/JavaCollectionTest.java index 12e790a7..c4338d5a 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/common/JavaCollectionTest.java +++ b/test/com/jwetherell/algorithms/data_structures/test/common/JavaCollectionTest.java @@ -78,6 +78,12 @@ private static > boolean addAndRemoveInOrder(Collection< return false; } + if (!IteratorTest.testIterator(collection.iterator())) { + System.err.println(name+" addAndRemoveInOrder iterator failed."); + Utils.handleError(data,collection); + return false; + } + for (int i = 0; i < data.length; i++) { Integer value = data[i]; T item = Utils.parseT(value, type); From 356dfb1daff89b983194c192c7534fa3b3a30126 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Thu, 21 Feb 2019 12:16:28 -0500 Subject: [PATCH 22/30] Fixed a bug in the getHeadValue of the Heap structures --- src/com/jwetherell/algorithms/data_structures/BinaryHeap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index ac2ae1f9..08855e28 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -372,7 +372,7 @@ public String toString() { protected static class HeapPrinter { public static > String getString(BinaryHeapArray tree) { - if (tree.array.length == 0) + if (tree.size == 0 || tree.array.length == 0) return "Tree has no nodes."; T root = tree.array[0]; From d3d1d03f029f2188b98579f7278b7e1221ad47db Mon Sep 17 00:00:00 2001 From: Nishant Ingle Date: Sat, 26 Oct 2019 17:06:15 +0530 Subject: [PATCH 23/30] Added Comment on Linear Search Logic --- src/com/jwetherell/algorithms/search/BinarySearch.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/jwetherell/algorithms/search/BinarySearch.java b/src/com/jwetherell/algorithms/search/BinarySearch.java index 8d3f8521..b0cbe03d 100644 --- a/src/com/jwetherell/algorithms/search/BinarySearch.java +++ b/src/com/jwetherell/algorithms/search/BinarySearch.java @@ -56,6 +56,7 @@ private static int recursiveFind(int value, int start, int end, boolean optimize } private static final int linearSearch(int value, int start, int end) { + // From index i = start to i = end check if value matches sorted[i] for (int i = start; i <= end; i++) { int iValue = sorted[i]; if (value == iValue) From 16f2fc18ff5ac71ae3eed21dcc4cb8aa7e6711c5 Mon Sep 17 00:00:00 2001 From: gauravdarbhanga <57192490+gauravdarbhanga@users.noreply.github.com> Date: Wed, 30 Oct 2019 23:48:53 +0530 Subject: [PATCH 24/30] Update BubbleSort.java adding comments on the method. --- src/com/jwetherell/algorithms/sorts/BubbleSort.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/sorts/BubbleSort.java b/src/com/jwetherell/algorithms/sorts/BubbleSort.java index 3ac320ff..824e4e17 100644 --- a/src/com/jwetherell/algorithms/sorts/BubbleSort.java +++ b/src/com/jwetherell/algorithms/sorts/BubbleSort.java @@ -21,7 +21,8 @@ public class BubbleSort> { private BubbleSort() { } - + //@param unsorted array + //@return sorted array public static > T[] sort(T[] unsorted) { boolean swapped = true; int length = unsorted.length; @@ -37,7 +38,7 @@ public static > T[] sort(T[] unsorted) { } return unsorted; } - + //swapping the value private static > void swap(int index1, int index2, T[] unsorted) { T value = unsorted[index1]; unsorted[index1] = unsorted[index2]; From 38d06ee316907262b20ba695f99c129e14eadef4 Mon Sep 17 00:00:00 2001 From: gauravdarbhanga <57192490+gauravdarbhanga@users.noreply.github.com> Date: Wed, 30 Oct 2019 23:59:12 +0530 Subject: [PATCH 25/30] Update CountingSort.java Did comment on the method. --- src/com/jwetherell/algorithms/sorts/CountingSort.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/jwetherell/algorithms/sorts/CountingSort.java b/src/com/jwetherell/algorithms/sorts/CountingSort.java index f1593c50..31e6a289 100644 --- a/src/com/jwetherell/algorithms/sorts/CountingSort.java +++ b/src/com/jwetherell/algorithms/sorts/CountingSort.java @@ -27,26 +27,26 @@ private CountingSort() { } public static Integer[] sort(Integer[] unsorted) { int maxValue = findMax(unsorted); - int[] counts = new int[maxValue + 1]; + int[] counts = new int[maxValue + 1];//counts number of elements updateCounts(unsorted, counts); populateCounts(unsorted, counts); return unsorted; } - + //finding maximum value in unsorted array private static int findMax(Integer[] unsorted) { - int max = Integer.MIN_VALUE; + int max = Integer.MIN_VALUE;//assume minimum value(-2147483648) of interger is maximum for (int i : unsorted) { if (i > max) max = i; } return max; } - + //Incrementing the number of counts in unsorted array private static void updateCounts(Integer[] unsorted, int[] counts) { for (int e : unsorted) counts[e]++; } - + private static void populateCounts(Integer[] unsorted, int[] counts) { int index = 0; for (int i = 0; i < counts.length; i++) { From 71d8b30bba0f426607412927279b53637f8b958b Mon Sep 17 00:00:00 2001 From: gauravdarbhanga <57192490+gauravdarbhanga@users.noreply.github.com> Date: Thu, 31 Oct 2019 00:06:22 +0530 Subject: [PATCH 26/30] Update BinarySearch.java --- src/com/jwetherell/algorithms/search/BinarySearch.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/search/BinarySearch.java b/src/com/jwetherell/algorithms/search/BinarySearch.java index 8d3f8521..42af2c2f 100644 --- a/src/com/jwetherell/algorithms/search/BinarySearch.java +++ b/src/com/jwetherell/algorithms/search/BinarySearch.java @@ -29,7 +29,8 @@ public static final int find(int value, int[] array, boolean optimize) { BinarySearch.sorted = null; } } - + //Recursively find the element + //@return find the element value by recursively private static int recursiveFind(int value, int start, int end, boolean optimize) { if (start == end) { int lastValue = sorted[start]; // start==end @@ -43,8 +44,10 @@ private static int recursiveFind(int value, int start, int end, boolean optimize final int middle = low + ((high - low) / 2); final int middleValue = sorted[middle]; + //checks if the middle index is element if (value == middleValue) return middle; + //if value is greater than move to right if (value > middleValue) { if (optimize && (end - middle) <= SWITCH_TO_BRUTE_FORCE) return linearSearch(value, middle + 1, end); @@ -54,7 +57,10 @@ private static int recursiveFind(int value, int start, int end, boolean optimize return linearSearch(value, start, middle - 1); return recursiveFind(value, start, middle - 1, optimize); } - + //Linear search to find the element. + //@value the element we want to find. + //@start first index of the array in the array + //@end last index of the array in the array. private static final int linearSearch(int value, int start, int end) { for (int i = start; i <= end; i++) { int iValue = sorted[i]; From 4e8de437ac1e921b319a8ff876e2ff81f1d9c7de Mon Sep 17 00:00:00 2001 From: gauravdarbhanga <57192490+gauravdarbhanga@users.noreply.github.com> Date: Thu, 31 Oct 2019 00:14:19 +0530 Subject: [PATCH 27/30] Update LowerBound.java --- src/com/jwetherell/algorithms/search/LowerBound.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/jwetherell/algorithms/search/LowerBound.java b/src/com/jwetherell/algorithms/search/LowerBound.java index 569e4532..9e6cd353 100644 --- a/src/com/jwetherell/algorithms/search/LowerBound.java +++ b/src/com/jwetherell/algorithms/search/LowerBound.java @@ -23,6 +23,7 @@ public static int lowerBound(int[] array, int length, int value) { int high = length; while (low < high) { final int mid = (low + high) / 2; + //checks if the value is less than middle element of the array if (value <= array[mid]) { high = mid; } else { From 769cb67c4364301a91ec82b7381ddb9f12b1a34e Mon Sep 17 00:00:00 2001 From: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> Date: Sat, 23 Nov 2019 17:16:39 -0800 Subject: [PATCH 28/30] Removed hedging and improved grammar in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 459c4d35..0101b605 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ Java : Algorithms and Data Structure ![alt tag](https://api.travis-ci.org/phishman3579/java-algorithms-implementation.svg?branch=master) ============================== -Algorithms and Data Structures implemented in Java +The algorithms and data structures are implemented in Java. -This is a collection of algorithms and data structures which I've implement over the years in my academic and professional life. The code isn't overly-optimized but is written to be correct and readable. The algorithms and data structures are well tested and, unless noted, are believe to be 100% correct. +This is a collection of algorithms and data structures I've implemented in my academic and professional life. The code isn't optimized but is written to be correct and readable. The algorithms and data structures are tested and, unless noted, believed to be correct. ## Created by Justin Wetherell From 81a028f7404765d5b80b882186cac7d1e3af0205 Mon Sep 17 00:00:00 2001 From: KisaragiEffective <48310258+KisaragiEffective@users.noreply.github.com> Date: Fri, 3 Jan 2020 01:50:13 +0900 Subject: [PATCH 29/30] Update README.md close #105 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 459c4d35..d2a96aaa 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ This is a collection of algorithms and data structures which I've implement over * [Hash Map (associative array)](src/com/jwetherell/algorithms/data_structures/HashMap.java) * [Interval Tree](src/com/jwetherell/algorithms/data_structures/IntervalTree.java) * [Implicit Key Treap](src/com/jwetherell/algorithms/data_structures/ImplicitKeyTreap.java) -* [KD Tree (k-dimensional tree or k-d tree)](src/com/jwetherell/algorithms/data_structures/KDTree.java) +* [KD Tree (k-dimensional tree or k-d tree)](src/com/jwetherell/algorithms/data_structures/KdTree.java) * [List [backed by an array or a linked list]](src/com/jwetherell/algorithms/data_structures/List.java) * [LCP Array (Longest Common Prefix) [backed by a Suffix Array]](src/com/jwetherell/algorithms/data_structures/LCPArray.java) * [Matrix](src/com/jwetherell/algorithms/data_structures/Matrix.java) From 6328fcf45f769b79c34089a4cf4ba50f909fa594 Mon Sep 17 00:00:00 2001 From: Justin Wetherell Date: Wed, 29 Jan 2020 08:17:54 -0500 Subject: [PATCH 30/30] Update .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 40a330e3..3a3703f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ before_script: - echo $JAVA_OPTS - echo $ANT_OPTS +dist: trusty + language: java jdk: