1、對長度為無窮大的廣義表,由于存儲空間的限制,不能在計算機中實現()
A.對
B.錯
2、輸入序列是ABC,輸出序列變為BCA時,經過的棧操作為()
A.push,push,push,pop,pop,pop
B.push,push,pop,push,pop,pop
C.push,pop,push,push,pop,pop
D.push,push,pop,pop,push,pop
3、假設以數組A[60]存放循環隊列的元素,其頭指針是front=47,當前隊列有50個元素,則隊列的尾指針值為()
A.3
B.37
C.97
D.50
4、在有向圖G的拓撲序列中,若頂點Vi在頂點Vj之前,則下列情形不可能出現的是()
A.G中有弧(Vi,Vj)
B.G中有一條從Vi到Vj的路徑
C.G中沒有弧(Vi,Vj)
D.G中有一條從Vj到Vi的路徑
5、有以下程序
#include
using namespace std;
int fun (int x,int y)
{
if(x==y)
return (x);
else
return ((x+y)/2);
}
int main()
{
int a=4,b=5,c=6;
printf("%d\n",fun(2*a,fun(b,c)));
}
程序的輸出是?
A.8
B.6
C.12
D.3
參考答案:
1~5:ABBDB