Created
November 13, 2021 21:17
-
-
Save kleinron/d3c066609fe7443808a897fbeadd0fc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DynamicArrayQueue { | |
constructor() { | |
this._arr = []; | |
} | |
enqueue(item) { | |
this._arr.push(item); | |
} | |
dequeue() { | |
return this._arr.shift(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment