Skip to content

Commit 539ce3e

Browse files
committed
[BAEL-9551] - Splitted algorithms into 4 modules
1 parent c10101a commit 539ce3e

File tree

164 files changed

+1735
-1241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+1735
-1241
lines changed

algorithms-genetic/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project

algorithms-genetic/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Relevant articles:
2+
3+
- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics)
4+
- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization)
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.baeldung</groupId>
5-
<artifactId>algorithms</artifactId>
6-
<version>0.0.1-SNAPSHOT</version>
7-
8-
<parent>
9-
<groupId>com.baeldung</groupId>
10-
<artifactId>parent-modules</artifactId>
11-
<version>1.0.0-SNAPSHOT</version>
12-
</parent>
13-
14-
<dependencies>
15-
<dependency>
16-
<groupId>org.apache.commons</groupId>
17-
<artifactId>commons-math3</artifactId>
18-
<version>${commons-math3.version}</version>
19-
</dependency>
20-
<dependency>
21-
<groupId>commons-codec</groupId>
22-
<artifactId>commons-codec</artifactId>
23-
<version>${commons-codec.version}</version>
24-
</dependency>
25-
<dependency>
26-
<groupId>org.projectlombok</groupId>
27-
<artifactId>lombok</artifactId>
28-
<version>${lombok.version}</version>
29-
<scope>provided</scope>
30-
</dependency>
31-
<dependency>
32-
<groupId>io.jenetics</groupId>
33-
<artifactId>jenetics</artifactId>
34-
<version>${io.jenetics.version}</version>
35-
</dependency>
36-
<dependency>
37-
<groupId>org.jgrapht</groupId>
38-
<artifactId>jgrapht-core</artifactId>
39-
<version>${org.jgrapht.core.version}</version>
40-
</dependency>
41-
<dependency>
42-
<groupId>pl.allegro.finance</groupId>
43-
<artifactId>tradukisto</artifactId>
44-
<version>${tradukisto.version}</version>
45-
</dependency>
46-
<dependency>
47-
<groupId>org.assertj</groupId>
48-
<artifactId>assertj-core</artifactId>
49-
<version>${org.assertj.core.version}</version>
50-
<scope>test</scope>
51-
</dependency>
52-
</dependencies>
53-
54-
<build>
55-
<pluginManagement>
56-
<plugins>
57-
<plugin>
58-
<groupId>org.codehaus.mojo</groupId>
59-
<artifactId>exec-maven-plugin</artifactId>
60-
<version>${exec-maven-plugin.version}</version>
61-
</plugin>
62-
</plugins>
63-
</pluginManagement>
64-
</build>
65-
66-
<reporting>
67-
<plugins>
68-
<plugin>
69-
<groupId>org.codehaus.mojo</groupId>
70-
<artifactId>cobertura-maven-plugin</artifactId>
71-
<version>2.7</version>
72-
<configuration>
73-
<instrumentation>
74-
<ignores>
75-
<ignore>com/baeldung/algorithms/dijkstra/*</ignore>
76-
</ignores>
77-
<excludes>
78-
<exclude>com/baeldung/algorithms/dijkstra/*</exclude>
79-
</excludes>
80-
</instrumentation>
81-
</configuration>
82-
</plugin>
83-
</plugins>
84-
</reporting>
85-
86-
<properties>
87-
<lombok.version>1.16.12</lombok.version>
88-
<commons-math3.version>3.6.1</commons-math3.version>
89-
<tradukisto.version>1.0.1</tradukisto.version>
90-
<io.jenetics.version>3.7.0</io.jenetics.version>
91-
<org.jgrapht.core.version>1.0.1</org.jgrapht.core.version>
92-
<org.assertj.core.version>3.9.0</org.assertj.core.version>
93-
<commons-codec.version>1.11</commons-codec.version>
94-
</properties>
95-
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>algorithms-genetic</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
8+
<parent>
9+
<groupId>com.baeldung</groupId>
10+
<artifactId>parent-modules</artifactId>
11+
<version>1.0.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.apache.commons</groupId>
17+
<artifactId>commons-math3</artifactId>
18+
<version>${commons-math3.version}</version>
19+
</dependency>
20+
<dependency>
21+
<groupId>commons-codec</groupId>
22+
<artifactId>commons-codec</artifactId>
23+
<version>${commons-codec.version}</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.projectlombok</groupId>
27+
<artifactId>lombok</artifactId>
28+
<version>${lombok.version}</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>io.jenetics</groupId>
33+
<artifactId>jenetics</artifactId>
34+
<version>${io.jenetics.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.jgrapht</groupId>
38+
<artifactId>jgrapht-core</artifactId>
39+
<version>${org.jgrapht.core.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>pl.allegro.finance</groupId>
43+
<artifactId>tradukisto</artifactId>
44+
<version>${tradukisto.version}</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.assertj</groupId>
48+
<artifactId>assertj-core</artifactId>
49+
<version>${org.assertj.core.version}</version>
50+
<scope>test</scope>
51+
</dependency>
52+
</dependencies>
53+
54+
<build>
55+
<pluginManagement>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.codehaus.mojo</groupId>
59+
<artifactId>exec-maven-plugin</artifactId>
60+
<version>${exec-maven-plugin.version}</version>
61+
</plugin>
62+
</plugins>
63+
</pluginManagement>
64+
</build>
65+
66+
<reporting>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.codehaus.mojo</groupId>
70+
<artifactId>cobertura-maven-plugin</artifactId>
71+
<version>2.7</version>
72+
<configuration>
73+
<instrumentation>
74+
<ignores>
75+
<ignore>com/baeldung/algorithms/dijkstra/*</ignore>
76+
</ignores>
77+
<excludes>
78+
<exclude>com/baeldung/algorithms/dijkstra/*</exclude>
79+
</excludes>
80+
</instrumentation>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</reporting>
85+
86+
<properties>
87+
<lombok.version>1.16.12</lombok.version>
88+
<commons-math3.version>3.6.1</commons-math3.version>
89+
<tradukisto.version>1.0.1</tradukisto.version>
90+
<io.jenetics.version>3.7.0</io.jenetics.version>
91+
<org.jgrapht.core.version>1.0.1</org.jgrapht.core.version>
92+
<org.assertj.core.version>3.9.0</org.assertj.core.version>
93+
<commons-codec.version>1.11</commons-codec.version>
94+
</properties>
95+
9696
</project>
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
package com.java.src;
2-
3-
import java.util.Scanner;
4-
5-
public class RoundUpToHundred {
6-
7-
public static void main(String[] args) {
8-
Scanner scanner = new Scanner(System.in);
9-
double input = scanner.nextDouble();
10-
scanner.close();
11-
12-
RoundUpToHundred.round(input);
13-
}
14-
15-
static long round(double input) {
16-
long i = (long) Math.ceil(input);
17-
return ((i + 99) / 100) * 100;
18-
};
19-
20-
}
1+
package com.java.src;
2+
3+
import java.util.Scanner;
4+
5+
public class RoundUpToHundred {
6+
7+
public static void main(String[] args) {
8+
Scanner scanner = new Scanner(System.in);
9+
double input = scanner.nextDouble();
10+
scanner.close();
11+
12+
RoundUpToHundred.round(input);
13+
}
14+
15+
static long round(double input) {
16+
long i = (long) Math.ceil(input);
17+
return ((i + 99) / 100) * 100;
18+
};
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
package com.java.src;
2-
3-
import static org.junit.Assert.assertEquals;
4-
5-
import org.junit.Test;
6-
7-
public class RoundUpToHundredTest {
8-
@Test
9-
public void givenInput_whenRound_thenRoundUpToTheNearestHundred() {
10-
assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99));
11-
assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2));
12-
assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400));
13-
}
14-
}
1+
package com.java.src;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
7+
public class RoundUpToHundredTest {
8+
@Test
9+
public void givenInput_whenRound_thenRoundUpToTheNearestHundred() {
10+
assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99));
11+
assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2));
12+
assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400));
13+
}
14+
}

algorithms-miscellaneous-1/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project

algorithms-miscellaneous-1/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Relevant articles:
2+
3+
- [Validating Input With Finite Automata in Java](http://www.baeldung.com/java-finite-automata)
4+
- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm)
5+
- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search)
6+
- [Binary Search Algorithm in Java](http://www.baeldung.com/java-binary-search)
7+
- [Introduction to Minimax Algorithm](http://www.baeldung.com/java-minimax-algorithm)
8+
- [How to Calculate Levenshtein Distance in Java?](http://www.baeldung.com/java-levenshtein-distance)
9+
- [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element)
10+
- [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm)
11+
- [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms)
12+
- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters)

algorithms-miscellaneous-1/pom.xml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>algorithms-miscellaneous-1</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
8+
<parent>
9+
<groupId>com.baeldung</groupId>
10+
<artifactId>parent-modules</artifactId>
11+
<version>1.0.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.apache.commons</groupId>
17+
<artifactId>commons-math3</artifactId>
18+
<version>${commons-math3.version}</version>
19+
</dependency>
20+
<dependency>
21+
<groupId>commons-codec</groupId>
22+
<artifactId>commons-codec</artifactId>
23+
<version>${commons-codec.version}</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.projectlombok</groupId>
27+
<artifactId>lombok</artifactId>
28+
<version>${lombok.version}</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>io.jenetics</groupId>
33+
<artifactId>jenetics</artifactId>
34+
<version>${io.jenetics.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.jgrapht</groupId>
38+
<artifactId>jgrapht-core</artifactId>
39+
<version>${org.jgrapht.core.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>pl.allegro.finance</groupId>
43+
<artifactId>tradukisto</artifactId>
44+
<version>${tradukisto.version}</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.assertj</groupId>
48+
<artifactId>assertj-core</artifactId>
49+
<version>${org.assertj.core.version}</version>
50+
<scope>test</scope>
51+
</dependency>
52+
</dependencies>
53+
54+
<build>
55+
<pluginManagement>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.codehaus.mojo</groupId>
59+
<artifactId>exec-maven-plugin</artifactId>
60+
<version>${exec-maven-plugin.version}</version>
61+
</plugin>
62+
</plugins>
63+
</pluginManagement>
64+
</build>
65+
66+
<reporting>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.codehaus.mojo</groupId>
70+
<artifactId>cobertura-maven-plugin</artifactId>
71+
<version>2.7</version>
72+
<configuration>
73+
<instrumentation>
74+
<ignores>
75+
<ignore>com/baeldung/algorithms/dijkstra/*</ignore>
76+
</ignores>
77+
<excludes>
78+
<exclude>com/baeldung/algorithms/dijkstra/*</exclude>
79+
</excludes>
80+
</instrumentation>
81+
</configuration>
82+
</plugin>
83+
</plugins>
84+
</reporting>
85+
86+
<properties>
87+
<lombok.version>1.16.12</lombok.version>
88+
<commons-math3.version>3.6.1</commons-math3.version>
89+
<tradukisto.version>1.0.1</tradukisto.version>
90+
<io.jenetics.version>3.7.0</io.jenetics.version>
91+
<org.jgrapht.core.version>1.0.1</org.jgrapht.core.version>
92+
<org.assertj.core.version>3.9.0</org.assertj.core.version>
93+
<commons-codec.version>1.11</commons-codec.version>
94+
</properties>
95+
96+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/

0 commit comments

Comments
 (0)