BAEL-2797 new domain "math"created, sections moved

This commit is contained in:
anilkivilcim.eray
2019-04-03 00:37:24 +03:00
parent 0a8d9fe187
commit 94bf17615c
184 changed files with 717 additions and 218 deletions
@@ -1,10 +1,10 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import java.util.Scanner;
import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing;
import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization;
import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm;
import com.baeldung.math.ga.annealing.SimulatedAnnealing;
import com.baeldung.math.ga.ant_colony.AntColonyOptimization;
import com.baeldung.math.ga.binary.SimpleGeneticAlgorithm;
public class RunAlgorithm {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
import lombok.Data;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
public class SimulatedAnnealing {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
import java.util.ArrayList;
import java.util.Collections;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.ant_colony;
package com.baeldung.math.ga.ant_colony;
public class Ant {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.ant_colony;
package com.baeldung.math.ga.ant_colony;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import lombok.Data;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import lombok.Data;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static org.jenetics.engine.EvolutionResult.toBestPhenotype;
import static org.jenetics.engine.limit.bySteadyFitness;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import java.util.function.Function;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import java.util.Random;
import java.util.stream.Collector;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import org.jenetics.BitChromosome;
import org.jenetics.BitGene;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.lang.Math.PI;
import static java.lang.Math.abs;
@@ -1,9 +1,9 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import org.junit.Assert;
import org.junit.Test;
import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization;
import com.baeldung.math.ga.ant_colony.AntColonyOptimization;
public class AntColonyOptimizationLongRunningUnitTest {
@@ -1,9 +1,9 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import org.junit.Assert;
import org.junit.Test;
import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm;
import com.baeldung.math.ga.binary.SimpleGeneticAlgorithm;
public class BinaryGeneticAlgorithmLongRunningUnitTest {
@@ -1,9 +1,9 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import org.junit.Assert;
import org.junit.Test;
import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing;
import com.baeldung.math.ga.annealing.SimulatedAnnealing;
public class SimulatedAnnealingLongRunningUnitTest {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Finite state machine.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Default implementation of a finite state machine.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* State. Part of a finite state machine.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Transition in a finite State machine.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.binarysearch;
package com.baeldung.math.binarysearch;
import java.util.Arrays;
import java.util.Collections;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.Arrays;
import java.util.Iterator;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import org.paukov.combinatorics3.Generator;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.Arrays;
import java.util.Set;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.enumstatemachine;
package com.baeldung.math.enumstatemachine;
public enum LeaveRequestState {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.factorial;
package com.baeldung.math.factorial;
import java.math.BigInteger;
import java.util.stream.LongStream;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.hillclimbing;
package com.baeldung.math.hillclimbing;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.hillclimbing;
package com.baeldung.math.hillclimbing;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.kthlargest;
package com.baeldung.math.kthlargest;
import java.util.Arrays;
import java.util.Collections;
@@ -1,10 +1,10 @@
package com.baeldung.algorithms.mcts.montecarlo;
package com.baeldung.math.mcts.montecarlo;
import java.util.List;
import com.baeldung.algorithms.mcts.tictactoe.Board;
import com.baeldung.algorithms.mcts.tree.Node;
import com.baeldung.algorithms.mcts.tree.Tree;
import com.baeldung.math.mcts.tictactoe.Board;
import com.baeldung.math.mcts.tree.Node;
import com.baeldung.math.mcts.tree.Tree;
public class MonteCarloTreeSearch {
@@ -1,10 +1,10 @@
package com.baeldung.algorithms.mcts.montecarlo;
package com.baeldung.math.mcts.montecarlo;
import java.util.ArrayList;
import java.util.List;
import com.baeldung.algorithms.mcts.tictactoe.Board;
import com.baeldung.algorithms.mcts.tictactoe.Position;
import com.baeldung.math.mcts.tictactoe.Board;
import com.baeldung.math.mcts.tictactoe.Position;
public class State {
private Board board;
@@ -1,10 +1,9 @@
package com.baeldung.algorithms.mcts.montecarlo;
package com.baeldung.math.mcts.montecarlo;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.baeldung.algorithms.mcts.tree.Node;
import com.baeldung.math.mcts.tree.Node;
public class UCT {
@@ -1,7 +1,6 @@
package com.baeldung.algorithms.mcts.tictactoe;
package com.baeldung.math.mcts.tictactoe;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Board {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.mcts.tictactoe;
package com.baeldung.math.mcts.tictactoe;
public class Position {
int x;
@@ -1,11 +1,11 @@
package com.baeldung.algorithms.mcts.tree;
package com.baeldung.math.mcts.tree;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.baeldung.algorithms.mcts.montecarlo.State;
import com.baeldung.math.mcts.montecarlo.State;
public class Node {
State state;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.mcts.tree;
package com.baeldung.math.mcts.tree;
public class Tree {
Node root;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.middleelementlookup;
package com.baeldung.math.middleelementlookup;
import java.util.LinkedList;
import java.util.Optional;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.middleelementlookup;
package com.baeldung.math.middleelementlookup;
public class Node {
private Node next;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.List;
import java.util.stream.Collectors;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.Comparator;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
public class Tree {
private Node root;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
/**
* Constants used by the Multi-swarm optimization algorithms.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
/**
* Interface for a fitness function, used to decouple the main algorithm logic
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;
import java.util.Random;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;
import java.util.Random;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.permutation;
package com.baeldung.math.permutation;
import java.util.Arrays;
import java.util.Collections;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
public class EnglishAlphabetLetters {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import java.util.HashMap;
import java.util.HashSet;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import java.util.HashSet;
import java.util.Set;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string.search;
package com.baeldung.math.string.search;
import java.math.BigInteger;
import java.util.Random;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class LinkedListFindMiddle {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class MyNode<E> {
MyNode<E> next;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class RotateArray {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class TwoSum {
@@ -1,7 +1,7 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import com.baeldung.algorithms.hillclimbing.HillClimbing;
import com.baeldung.algorithms.hillclimbing.State;
import com.baeldung.math.hillclimbing.HillClimbing;
import com.baeldung.math.hillclimbing.State;
import org.junit.Before;
import org.junit.Test;
@@ -1,7 +1,7 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import com.baeldung.algorithms.middleelementlookup.MiddleElementLookup;
import com.baeldung.algorithms.middleelementlookup.Node;
import com.baeldung.math.middleelementlookup.MiddleElementLookup;
import com.baeldung.math.middleelementlookup.Node;
import org.junit.Test;
import java.util.LinkedList;
@@ -1,6 +1,6 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import com.baeldung.algorithms.automata.*;
import com.baeldung.math.automata.*;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
@@ -1,10 +1,10 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import org.junit.Assert;
import org.junit.Test;
import com.baeldung.algorithms.string.search.StringSearchAlgorithms;
import com.baeldung.math.string.search.StringSearchAlgorithms;
public class StringSearchAlgorithmsUnitTest {
@@ -1,11 +1,10 @@
package com.baeldung.algorithms.binarysearch;
package com.baeldung.math.binarysearch;
import java.util.Arrays;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.baeldung.algorithms.binarysearch.BinarySearch;
public class BinarySearchUnitTest {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.enumstatemachine;
package com.baeldung.math.enumstatemachine;
import static org.junit.Assert.assertEquals;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.factorial;
package com.baeldung.math.factorial;
import static org.assertj.core.api.Assertions.assertThat;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.kthlargest;
package com.baeldung.math.kthlargest;
import static org.assertj.core.api.Assertions.*;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.mcts;
package com.baeldung.math.mcts;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -8,12 +8,12 @@ import java.util.List;
import org.junit.Before;
import org.junit.Test;
import com.baeldung.algorithms.mcts.montecarlo.MonteCarloTreeSearch;
import com.baeldung.algorithms.mcts.montecarlo.State;
import com.baeldung.algorithms.mcts.montecarlo.UCT;
import com.baeldung.algorithms.mcts.tictactoe.Board;
import com.baeldung.algorithms.mcts.tictactoe.Position;
import com.baeldung.algorithms.mcts.tree.Tree;
import com.baeldung.math.mcts.montecarlo.MonteCarloTreeSearch;
import com.baeldung.math.mcts.montecarlo.State;
import com.baeldung.math.mcts.montecarlo.UCT;
import com.baeldung.math.mcts.tictactoe.Board;
import com.baeldung.math.mcts.tictactoe.Position;
import com.baeldung.math.mcts.tree.Tree;
public class MCTSUnitTest {
private Tree gameTree;
@@ -1,11 +1,9 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import com.baeldung.algorithms.minimax.MiniMax;
import com.baeldung.algorithms.minimax.Tree;
public class MinimaxUnitTest {
private Tree gameTree;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
/**
* Specific fitness function implementation to solve the League of Legends
@@ -1,10 +1,10 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import com.baeldung.algorithms.support.MayFailRule;
import com.baeldung.math.support.MayFailRule;
/**
* Test for {@link Multiswarm}.
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -1,10 +1,10 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static com.baeldung.algorithms.string.LongestSubstringNonRepeatingCharacters.getUniqueCharacterSubstring;
import static com.baeldung.algorithms.string.LongestSubstringNonRepeatingCharacters.getUniqueCharacterSubstringBruteForce;
import static com.baeldung.math.string.LongestSubstringNonRepeatingCharacters.getUniqueCharacterSubstring;
import static com.baeldung.math.string.LongestSubstringNonRepeatingCharacters.getUniqueCharacterSubstringBruteForce;
public class LongestSubstringNonRepeatingCharactersUnitTest {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import static org.junit.Assert.assertEquals;
import java.util.HashSet;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.support;
package com.baeldung.math.support;
import org.junit.Rule;
import org.junit.rules.TestRule;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
import static org.assertj.core.api.Assertions.assertThat;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
import static org.assertj.core.api.Assertions.assertThat;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -1,8 +1,8 @@
package com.baeldung.algorithms;
package com.baeldung.math;
import java.util.Scanner;
import com.baeldung.algorithms.slope_one.SlopeOne;
import com.baeldung.math.slope_one.SlopeOne;
public class RunAlgorithm {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.conversion;
package com.baeldung.math.conversion;
import java.math.BigInteger;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
public class EditDistanceDynamicProgramming extends EditDistanceBase {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
public class EditDistanceRecursive extends EditDistanceBase {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashSet;
import java.util.LinkedList;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashSet;
import java.util.Set;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashMap;
import java.util.LinkedList;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionBruteForce {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionByFastAndSlowIterators {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
import java.util.HashSet;
import java.util.Set;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionResult<T> {
boolean cycleExists;
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleRemovalBruteForce {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleRemovalByCountingLoopNodes {
@@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleRemovalWithoutCountingLoopNodes {

Some files were not shown because too many files have changed in this diff Show More