题目内容

下列有关数组的声明中,正确的是哪项?(选两项)

A. int s[10];
B. int[10] s;
C. int[ ] s={1, 2, 3, 4, 5};
D. int s[ ];

查看答案
更多问题

The sequential search algorithm: 顺序搜索算法:

A. requires the array to be ordered 要求数组是有序的
B. must always be implemented as a method 必须始终作为一种方法来实现
C. uses a loop to sequentially step through an array, starting with the first element循环来依次遍历一个数组,从第一个元素开始
D. will not execute, if the element is not in the array 如果元素不在数组中,则不执行。

In order to do a binary search on an array, 为了对数组进行二分查找

A. the values of the array must be numeric 数组的值必须是数值型的
B. the array must first be sorted in ascending order 数组必须先按升序排序
C. you must first do a sequential search of the array to assure the element you are looking for is there 你必须首先对数组进行顺序搜索,以确保您要查找的元素在其中 d. There are no requirements 没有要求

If numbers is a two-dimensional array, which of the following would give the length of row r? 如果numbers是一个二维数组,下面哪个选项会给出r行的长度?

A. numbers.length
B. numbers.length[r]
C. numbers[r].length[r]
D. numbers[r].length

Which of the following is a correct method header for receiving a two-dimensional array as an argument? 下列哪个是接收二维数组作为参数的正确方法头?

A. public static void passArray(int[1,2])
B. public static void passArray(int [][])
C. public static void passArray(int[1],[2])
D. public static void passArray(int[], int[])

答案查题题库