diff --git a/Main.java b/Main.java index adab3b2..6d395ba 100644 --- a/Main.java +++ b/Main.java @@ -97,5 +97,42 @@ public class Main { return result; } + + public static LinkedList shiftList(LinkedList p, int places){ + + LinkedList result = new LinkedList(p); + + if(places == 0) { + return result; + } + + for(; places>0; places--) { + result.addFirst(0); + } + return result; + } + + + public static LinkedList polynomialsMultiplication(LinkedList p1, LinkedList p2){ + + // suma dlugosci + int amount = p1.size() + p2.size(); + + // nowy wielomian bedzie dlugosci sumy poteg wyrazow wiodacych obu tablic -1 + LinkedList result = new LinkedList(); + + for(int i=0;i