作者:宋雨甄_938 | 来源:互联网 | 2023-05-19 07:45
Here is the code I have so far:
这是我到目前为止的代码:
public static int mode(int[][] arr) {
ArrayList list = new ArrayList();
int temp = 0;
for(int i = 0; i
I seem to be stuck at this point on how to get [i][s]
into a single dimensional array. When I do a print(temp)
all the elements of my 2D array print out one a time in order but cannot figure out how to get them into the 1D array. I am a novice :(
关于如何将[i] [s]变成单维数组,我似乎陷入了困境。当我执行print(temp)时,我的2D数组的所有元素按顺序打印出一次,但无法弄清楚如何将它们放入1D数组。我是新手:(
How to convert a 2D array into a 1D array?
如何将2D数组转换为1D数组?
The current 2D array I am working with is a 3x3. I am trying to find the mathematical mode of all the integers in the 2D array if that background is of any importance.
我正在使用的当前2D阵列是3x3。我试图找到2D数组中所有整数的数学模式,如果该背景具有任何重要性。
4 个解决方案