From 7b0bd3d83cbecfbc03ed0d3913e2dd89b8025907 Mon Sep 17 00:00:00 2001 From: Krystian Madra Date: Thu, 28 Jun 2018 07:53:40 +0200 Subject: [PATCH] add nilpotent --- Main.java | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Main.java b/Main.java index 2bb51b6..066f003 100644 --- a/Main.java +++ b/Main.java @@ -270,6 +270,43 @@ public class Main { return result; } + + + public static LinkedList> nilpotent(LinkedList> elements,LinkedList expect, int mod) { + + LinkedList> result = new LinkedList>(); + LinkedList temp = new LinkedList(); + + LinkedList tempPow = new LinkedList(); + + result.add(elements.get(0)); + + for(int i=1; i= expect.size()) { + temp = dividePolynomials(temp, expect, mod); + } + else continue; + + if(temp.size() == 1 && temp.getFirst() == 0) { + result.add(elements.get(i)); + } + } + return result; + + } + } \ No newline at end of file