Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e8f28f

Browse files
authored
Use exist method to be consistent with Stack (trekhleb#708)
1 parent d227646 commit 8e8f28f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/data-structures/queue/Queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class Queue {
2121
* @return {*}
2222
*/
2323
peek() {
24-
if (!this.linkedList.head) {
24+
if (this.isEmpty()) {
2525
return null;
2626
}
2727

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /