We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 702840b commit b883757Copy full SHA for b883757
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.queue.length>0) ? this.queue.length - 1 : 0
81
}
82
83
// Display the top most value of queue
0 commit comments