//****PROBLEM 4*** import java.util.Arrays; // You may use Arrays.copyOfRange method public class Karatsuba { public static void main(String [] args) { } public static int [] mult_10_to_m(int [] a,...

I need this coded


//****PROBLEM 4*** import java.util.Arrays; // You may use Arrays.copyOfRange method public class Karatsuba { public static void main(String [] args) { } public static int [] mult_10_to_m(int [] a, int m) { return new int[]{}; } public static int [] mod_10_to_m(int [] a, int m) { return new int[]{}; } public static int [] div_10_to_m(int [] a, int m) { return new int[]{}; } public static int [] add(int [] a, int [] b) { return new int[]{}; } public static int [] subtract(int [] a, int [] b) { // This assumes a is greater than or equal to b return new int[]{}; } public static int [] multiply (int [] a, int [] b) { // Base case code (don't change) ======= if (isZero(a) || isZero(b)) return getZero(); int n = Math.max(a.length, b.length); if (n == 1) return baseCaseMultiply(a, b); //======================================= // Complete the method below: return new int[]{}; } // ====== DO NOT CHANGE ANYTHING BELOW THIS LINE! =============== public static int [] baseCaseMultiply(int [] a, int [] b) { int prod = a[0] * b[0]; if (prod < 10)="" return="" new="" int[]{prod};="" else="" return="" new="" int[]{prod/10,="" prod="" %10};="" }="" public="" static="" boolean="" iszero(int="" []="" a)="" {="" return="" a.length="=" 1="" &&="" a[0]="=" 0;="" }="" public="" static="" int="" []="" getzero()="" {="" return="" new="" int[]{0};="" }="" public="" static="" int="" []="" trim(int="" []="" a)="" {="" int="" i="0;" while="" (i="">< a.length && a[i] == 0) i++; if (i == a.length) return new int[]{0}; return arrays.copyofrange(a, i, a.length); } } //problem 7 **** public class warshallfloyd { // write the warshall r4 matrix here: public static int[][] r4; public static void main(string[] args) { } // write the floyd algorithm here: public static double[][] floyd(double[][] w, int n) { return null; } } a.length="" &&="" a[i]="=" 0)="" i++;="" if="" (i="=" a.length)="" return="" new="" int[]{0};="" return="" arrays.copyofrange(a,="" i,="" a.length);="" }="" }="" problem="" 7="" ****="" public="" class="" warshallfloyd="" {="" write="" the="" warshall="" r4="" matrix="" here:="" public="" static="" int[][]="" r4;="" public="" static="" void="" main(string[]="" args)="" {="" }="" write="" the="" floyd="" algorithm="" here:="" public="" static="" double[][]="" floyd(double[][]="" w,="" int="" n)="" {="" return="" null;="" }="">
Oct 11, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here