Question: Write a function that takes a dynamic array and changes it to a 3x3 2-Dimensional array. Dynamic array: ArrayList dy_arr=new ArrayList(Arrays.asList(5,9,2, 9,5,6,1,8,5)); Function signature: public

Write a function that takes a dynamic array and changes it to a 3x3 2-Dimensional array.

Dynamic array: ArrayListdy_arr=new ArrayList(Arrays.asList(5,9,2, 9,5,6,1,8,5));

Function signature: public static Integer[][] to2D(ArrayListdy_arr)

Please do it on java and provide the code

fast please

Input:

5

9

2

9

5

6

1

8

5

Output:

5

9

2

9

5

6

1

8

5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!