通过海量题库、编程比赛和实时排名,系统化提升您的编程能力。
分析以下函数的功能,其中参数q为队列
def algol (q) : s=ArrayStack () while not q.empty () : x=q.serve () s.push (x) while not s.empty () : x=s.get_top () s.pop() q.append (x)
1