From bf3dacbbc67de56e26976ec198f6fcc8a2b00922 Mon Sep 17 00:00:00 2001 From: Krystian Madra Date: Thu, 28 Jun 2018 00:29:45 +0200 Subject: [PATCH] multiply polynomial --- Main.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Main.java b/Main.java index 62a28a9..adab3b2 100644 --- a/Main.java +++ b/Main.java @@ -87,4 +87,15 @@ public class Main { return result; } + public static LinkedList multiplyPolynomial(LinkedList p1, int multiplier){ + + LinkedList result = new LinkedList(); + + while(!p1.isEmpty()) { + result.add(p1.poll() * multiplier); + } + + return result; + } + } \ No newline at end of file