VERTEXCOVER
VERTEXCOVER
return (x < y) ? x : y;
int data;
};
if (root == null)
return 0;
return 0;
vCover(root.right);
int size_excl = 0;
if (root.left != null)
size_excl += 1 + vCover(root.left.left) +
vCover(root.left.right);
if (root.right != null)
size_excl += 1 + vCover(root.right.left) +
vCover(root.right.right);
temp.data = data;
return temp;
root.left = newNode(2);
root.left.left = newNode(1);
root.left.right = newNode(4);
root.left.right.left = newNode(2);
root.left.right.right = newNode(5);
root.left.right.right.left = newNode(4);
root.left.right.right.right = newNode(8);
root.right = newNode(3);
root.right.right = newNode(6);
root.right.right.left = newNode(3);
root.right.right.right = newNode(7);
root.right.right.right.left = newNode(6);
root.right.right.right.right = newNode(8);
root.right.left = newNode(1);
FERMAT
if((Math.pow(base, exp))%mod == 1)
return true;
else
{
return false;
Fermat(5,7) + "\n");
SETCOVER
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/*
*/
/**
* @author USER HP
*/
interface Filter<T> {
Integer[][] arrayOfSets = {
{1,2,4},
{2,3,4},
{4,5},
{3,4,5},
};
listOfSets.add(new LinkedHashSet<Integer>(Arrays.asList(array)));
union.addAll(ints);
return union.equals(solutionSet);
};
for(int l = 0;l<combinations;l++) {
for(int j=0;j<size;j++) {
combination.add(listOfSets.get(j));
possibleSolutions.add(combination);
return o1.size()-o2.size();
});
if (filter.matches(possibleSolution))
return possibleSolution;
}
return null;