diff --git a/Main.java b/Main.java index 06d4472..418613d 100644 --- a/Main.java +++ b/Main.java @@ -23,20 +23,22 @@ public class Main { LinkedList polynomial = new LinkedList(); - //test poly - LinkedList polynomial2 = new LinkedList(); - // wypelnienie wielomianu polynomial = fill(polynomialNumbers, polynomial); - //test + // candidates LinkedList> elements = new LinkedList>(); elements = createCandidates(polynomial,mod); - // Idemp + // output + // odwracalne + System.out.println(reversible(elements,polynomial,mod)); + // dzielniki zera + System.out.println(zeroDivisors(elements,polynomial,mod)); + // nilpotenty + System.out.println(nilpotent(elements,polynomial,mod)); + // idempotenty System.out.println(idempotent(elements,polynomial,mod)); - - //showPoly(polynomial); } // wypelnienie wielomianu @@ -347,5 +349,35 @@ public class Main { } return p1; - } + } + + + public static LinkedList> zeroDivisors(LinkedList> elements,LinkedList expect, int mod) { + + LinkedList> result = new LinkedList>(); + LinkedList temp = new LinkedList(); + LinkedList tempSec = new LinkedList(); + LinkedList pfinal = new LinkedList(); + + result.add(elements.get(0)); + + for(int i=1; i