Last active
April 1, 2019 19:37
-
-
Save johnnyferreiradev/cd1a320eb659b0774b95827a2e790ff9 to your computer and use it in GitHub Desktop.
Algoritmo de Fila implementado em uma classe ES6 ou superior
This file contains hidden or 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
| function Fila(list) { | |
| this.list = list | |
| this.add = elem => { | |
| this.list.push(elem) | |
| return this.list | |
| } | |
| this.remove = () => { | |
| this.list.shift() | |
| return this.list | |
| } | |
| this.isEmpty = () => { | |
| const status = this.list.length == 0 ? true : false | |
| return status | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment