lcof/9/ #2548
lcof/9/ #2548
Replies: 1 comment 2 replies
-
方法二:数组+双指针 classCQueue{privateint[] queue; privateinthead; privateinttail; privateintcapacity; publicCQueue(){capacity = 10000; queue = newint[capacity]; tail = 1; head = 0} publicvoidappendTail(intvalue){queue[((tail++ - 1) % capacity)] = value} publicintdeleteHead(){if ((head + 1 % capacity) == tail) return -1; returnqueue[head++ % capacity]} } |
BetaWas this translation helpful?Give feedback.
2 replies
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
lcof/9/
多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解
https://leetcode.doocs.org/lcof/9/
BetaWas this translation helpful?Give feedback.
All reactions