1、已有变量定义和函数调用语句
int a=25;
print_value(&a);
则下面函数的正确输出结果是______。
void print_value(int* x)
{
printf(“%x\n”,++*x);
}
A.1a
B.19
C.25
D.26
2、现有一个循环队列,其队头指针为 front,队尾指针为 rear,循环队列的总长度为 N,问怎么判断循环队列满了?
A.front==rear
B.front==rear+1
C.front==rear%n
D.front==(rear+1)%n
3、选项中哪一行代码可以添加 题目中而不产生编译错误?
public abstract class MyClass {
public int constInt = 5;
//add code here
public void method() {
}
}
正确答案: A 你的答案: 空 (错误)
A.public abstract void method(int a);
B.constInt = constInt + 5;
C.public int method();
D.public abstract void anotherMethod() {}
4、int (*s[10])(int) 表示的是什么?
A.指针数组,每个指针指向长度为1的int数组
B.指针数组,每个指针指向长度为10的int数组
C.函数指针数组,每个指针指向一个int func(int* param)的函数。
D.函数指针数组,每个指针指向一个int func(int param)的函数。
5、入栈序列是:a1, a3, a5, a2, a4, a6,出栈序列是:a5, a4, a2, a6, a3, a1,则栈的容量小是多少()
A.2
B.3
C.4
D.5
[多选]
6、以下操作中,数组比线性表速度更快的是____
A.原地逆序
B.头部插入
C.返回中间节点
D.返回头部节点
E.选择随机节点
7、批量删除当前目录下后缀名为.c的文件。如a.c、b.c。
A.rm *.c
B.find . -name "*.c" -maxdepth 1 | xargs rm
C.find . -name "*.c" | xargs rm
D.以上都不正确
参考答案:
1~5:ADADC 6~7:ACE AB