mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-10 11:09:43 +08:00
Use exist method to be consistent with Stack (#708)
This commit is contained in:
parent
d227646201
commit
8e8f28ffcf
@ -21,7 +21,7 @@ export default class Queue {
|
|||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
peek() {
|
peek() {
|
||||||
if (!this.linkedList.head) {
|
if (this.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user