![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
写出以下程序段的输出结果(队列中的元素类型Q Elem Type为char)。
写出以下程序段的输出结果(队列中的元素类型Q Elem Type为char)。
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
写出以下程序段的输出结果(队列中的元素类型Q Elem Type为char)。
写出下列程序段的输出结果。(假设此栈中元素的类型是char)
voide main()
{stack s;
char x,y;
InitStack(s)
x=‘1’,y=‘0’
push(s,x);
push(s,x);
push(s,y);
push(s,x);
push(s,‘e’);
push(s,x);
pop(s,x);
push(s,‘h’);
while(!stackEmpty(s))
{pop(s,y);
printf(y);
}
prinft(x)
}
A.通过编译,但不能连接
B.有语法错,不能通过编译
C.输出** **
D.输出## ##
写出程序的输出结果:
Private Sub Form_Click
Print Tab(10); -100;Tab(20); 200;Tab(30); -300
Print Spc(5); -100;Spc(5); 200;Spc(5); -300
End Sub
阅读下列程序,请写出该程序的输出结果。
public class C
{
int x=10;
static int y=20;
public static void main(String[] args)
{
C obj1=newC();
C obj2=newC();
obj1.x*=2;
obj1.y*=3;
obj2.x+=4;
obj2.y+=5;
System.out.println(obj1.x);
System.out.println(obj1.y);
System.out.println(obj2.x);
System.out.println(obj2.y);
}
}
(1)写出队满的条件表达式;
(2)写出队空的条件表达式;
(3)设m=40,rear=13,quelen=19,求队头元素的位置;
(4)写出一般情况下队头元素位置的表达式。
阅读下列程序并写出程序运行结果。
Public Sub change1(ByVal x As Integer, ByVal y As Integer)
Dim t As Integer
t = x
x = y
y = t
End Sub
Public Sub change2(x As Integer, y As Integer)
Dim t As Integer
t = x
x = y
y = t
End Sub
Private Sub Form_Click()
Dim a As Integer, b As Integer
a = 22: b = 33
change1 a, b
Form1.Print "A1="; a, "B1="; b
a = 22: b = 33
change2 a, b
Form1.Print "A2="; a, "B2="; b
End Sub
写出程序运行时,单击窗体Form1上的输出结果。
有一字符序列abcde依次按照某一线性结构存储,请回答以下问题:
(1)、如果该线性结构是队列,那么,写出出队序列。
(2)、如果该线性结构是栈,那么,输出序列可能是d,c,e,a,b吗,为什么?
(3)、如果该线性结构是栈,且输出序列是abcde。请写出操作过程。(push(x):表示把x压入栈内;pop(x):表示把x弹出栈)
A.5 8 12 15 30
B.12 15 5 30 18
C.8 12 15 30 18
D.12 15 5 18 30