数据结构基础 队列

1-1
所谓“循环队列”是指用单向循环链表或者循环数组表示的队列。 F
数组是错的
1-2
“Circular Queue” is defined to be a queue implemented by a circularly linked list or a circular array. F
循环队列”定义为循环链表或循环数组实现的队列
数组是错的
1-3
An algorithm to check for balancing symbols in an expression uses a queue to store the partial expression. F
检查表达式中平衡符号的算法使用队列(应为栈)来存储部分表达式
2-6
Following is the C-like pseudo code of a function that takes a Queue as an argument.

void foo(Queue Q)
{
Stack S = CreateStack(); // create an empty stack

while (!IsEmpty(Q))
{
    // dequeue an item from Q and push it into S
    Push(S, Dequeue(Q));
}

while (!IsEmpty(S))
{
    // pop an item from S and enqueue it into Q
    Enqueue(Q, Pop(S));
}

DisposeStack(S);

}
What does the above function do? D
A.Removes the last item from Q
B.Keeps Q unchanged
C.Makes Q empty
D.Reverses(反转) Q

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值