学进去-教育应平等而普惠
试题
类型:选择题
难度系数:0.65
所属科目:高中信息技术
找出序列中的最大数,并将其放到序列的最后面。实现上述功能的代码如下:
#链表a中存储了序列数据,head为其头指针,代码略
pre=p=head
maxpre=maxp=head
while p!=-1:
     if a[p][0]>a[maxp][0]:
            maxp=p ; maxpre=pre
     pre=p
     p=a[p][1]
if maxp==head:
     head=a[head][1]
elif maxp!=pre:
     
a[pre][1]=maxp

#遍历输出链表a
划线处的代码应为(     
A.①a[maxp][1]=a[maxpre][1]                 ②a[maxp][1]=a[p][1]
B.①a[maxp][1]=a[maxpre][1]                 ②a[maxp][1]=p
C.①a[maxpre][1]=a[maxp][1]                 ②a[maxp][1]=a[p][1]
D.①a[maxpre][1]=a[maxp][1]                 ②a[maxp][1]=p
编辑解析赚收入
收藏
|
有奖纠错

同类型试题

优质答疑

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

用户名称
2019-09-19

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

用户名称
2019-09-19
我要答疑
编写解析
解析:

奖学金将在审核通过后自动发放到帐

提交
我要答疑
我要答疑:
提交