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

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
public class SimulatedAnnealing {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.annealing;
package com.baeldung.math.ga.annealing;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.ant_colony;
package com.baeldung.math.ga.ant_colony;
public class Ant {

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.binary;
package com.baeldung.math.ga.binary;
import lombok.Data;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import java.util.function.Function;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import org.jenetics.BitChromosome;
import org.jenetics.BitGene;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.jenetics;
package com.baeldung.math.ga.jenetics;
import static java.util.Objects.requireNonNull;

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Finite state machine.

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Default implementation of a finite state machine.

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* State. Part of a finite state machine.

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.automata;
package com.baeldung.math.automata;
/**
* Transition in a finite State machine.

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.binarysearch;
package com.baeldung.math.binarysearch;
import java.util.Arrays;
import java.util.Collections;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.Arrays;
import java.util.Iterator;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import org.paukov.combinatorics3.Generator;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.Arrays;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.enumstatemachine;
package com.baeldung.math.enumstatemachine;
public enum LeaveRequestState {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.factorial;
package com.baeldung.math.factorial;
import java.math.BigInteger;
import java.util.stream.LongStream;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.hillclimbing;
package com.baeldung.math.hillclimbing;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.hillclimbing;
package com.baeldung.math.hillclimbing;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.kthlargest;
package com.baeldung.math.kthlargest;
import java.util.Arrays;
import java.util.Collections;

View File

@ -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 {

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.mcts.tictactoe;
package com.baeldung.math.mcts.tictactoe;
public class Position {
int x;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.mcts.tree;
package com.baeldung.math.mcts.tree;
public class Tree {
Node root;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.middleelementlookup;
package com.baeldung.math.middleelementlookup;
import java.util.LinkedList;
import java.util.Optional;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.middleelementlookup;
package com.baeldung.math.middleelementlookup;
public class Node {
private Node next;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.List;
import java.util.stream.Collectors;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.Comparator;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.minimax;
package com.baeldung.math.minimax;
public class Tree {
private Node root;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
/**
* Constants used by the Multi-swarm optimization algorithms.

View File

@ -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

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;
import java.util.Random;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
import java.util.Arrays;
import java.util.Random;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.permutation;
package com.baeldung.math.permutation;
import java.util.Arrays;
import java.util.Collections;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
public class EnglishAlphabetLetters {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import java.util.HashMap;
import java.util.HashSet;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import java.util.HashSet;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.string.search;
package com.baeldung.math.string.search;
import java.math.BigInteger;
import java.util.Random;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class LinkedListFindMiddle {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class MyNode<E> {
MyNode<E> next;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class RotateArray {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
public class TwoSum {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.combination;
package com.baeldung.math.combination;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.enumstatemachine;
package com.baeldung.math.enumstatemachine;
import static org.junit.Assert.assertEquals;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.factorial;
package com.baeldung.math.factorial;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.kthlargest;
package com.baeldung.math.kthlargest;
import static org.assertj.core.api.Assertions.*;

View File

@ -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;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.multiswarm;
package com.baeldung.math.multiswarm;
/**
* Specific fitness function implementation to solve the League of Legends

View File

@ -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}.

View File

@ -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;

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.string;
package com.baeldung.math.string;
import static org.junit.Assert.assertEquals;
import java.util.HashSet;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.support;
package com.baeldung.math.support;
import org.junit.Rule;
import org.junit.rules.TestRule;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.twopointertechnique;
package com.baeldung.math.twopointertechnique;
import static org.assertj.core.api.Assertions.assertThat;

View File

@ -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;

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.conversion;
package com.baeldung.math.conversion;
import java.math.BigInteger;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
import java.util.Arrays;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
public class EditDistanceDynamicProgramming extends EditDistanceBase {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.editdistance;
package com.baeldung.math.editdistance;
public class EditDistanceRecursive extends EditDistanceBase {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashSet;
import java.util.LinkedList;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashSet;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.ga.dijkstra;
package com.baeldung.math.ga.dijkstra;
import java.util.HashMap;
import java.util.LinkedList;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionBruteForce {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionByFastAndSlowIterators {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
import java.util.HashSet;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleDetectionResult<T> {
boolean cycleExists;

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleRemovalBruteForce {

View File

@ -1,4 +1,4 @@
package com.baeldung.algorithms.linkedlist;
package com.baeldung.math.linkedlist;
public class CycleRemovalByCountingLoopNodes {

View File

@ -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