Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d920e7f commit 314144fCopy full SHA for 314144f
1 file changed
Data-Structures/Queue/CircularQueue.js
@@ -77,7 +77,7 @@ class CircularQueue {
77
78
// Displays the length of queue
79
length() {
80
- return this.queue.length - 1
+ return this.checkEmpty() ? 0 : this.queue.length - 1
81
}
82
83
// Display the top most value of queue
0 commit comments