Skip to content

Commit

Permalink
Added travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgi Eftimov authored and Georgi Eftimov committed Oct 16, 2013
1 parent fb60db8 commit 08284c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 43 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

language: java

mvn clean install
25 changes: 13 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
<version>0.0.1-SNAPSHOT</version>
<name>Algorithms</name>
<description>Algorithms</description>
<dependencies>
<dependency>
<groupId>com.eftimoff</groupId>
<artifactId>algs</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.eftimoff</groupId>
<artifactId>stdlib</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
31 changes: 0 additions & 31 deletions src/main/java/com/eftimoff/algorithms/WeightedQuickUnionUF.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
package com.eftimoff.algorithms;

import com.eftimoff.algorithms.support.StdIn;
import com.eftimoff.algorithms.support.StdOut;

/****************************************************************************
* Compilation: javac WeightedQuickUnionUF.java Execution: java WeightedQuickUnionUF < input.txt Dependencies: StdIn.java
* StdOut.java
*
* Weighted quick-union (without path compression).
*
****************************************************************************/

public class WeightedQuickUnionUF
{
private int[] id; // id[i] = parent of i
Expand Down Expand Up @@ -72,24 +61,4 @@ public void union(int p, int q)
count--;
}

public static void main(String[] args)
{
int N = StdIn.readInt();
WeightedQuickUnionUF uf = new WeightedQuickUnionUF(N);

// read in a sequence of pairs of integers (each in the range 0 to N-1),
// calling find() for each pair: If the members of the pair are not already
// call union() and print the pair.
while (!StdIn.isEmpty())
{
int p = StdIn.readInt();
int q = StdIn.readInt();
if (uf.connected(p, q))
continue;
uf.union(p, q);
StdOut.println(p + " " + q);
}
StdOut.println(uf.count() + " components");
}

}

0 comments on commit 08284c8

Please sign in to comment.