如何用临时队列对队列进行分类?

发布于 2025-02-02 12:10:02 字数 192 浏览 2 评论 0原文

我非常业余,编码不好。 有一个带有元素的队列和另一个空的队列。这些队列不是数组,而是使用此空排队的通用,您必须对原始队列进行排序。方式:将Q1头列为其他Q2 --->如果Q1 Head≪ Q2 lastelement Q1 Q1HEAD其他Q1head将Q1HEAD与Q2相关。 我了解它的发展,但我无法编码。有人可以为我编码,因为这是学校的AA功课。 :)

I'm very amateur and bad with coding.
there's a queue with elements and another empty queue. and these queues aren't arrays but generic with this empty queue you have to sort the original queue. The way: dequeue the q1head to other q2 ---> if q1 head < q2lastelement then enqueue q1head else enqueue q1head to q2.
I understand how it goes but I can't code. could someone code this for me please, because this is a a homework for school. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文