DEV Community

Discussion on: Javascript: How to implement a queue

Collapse
 
chinedu profile image
chinedu | ddevguys

This awesome! Would definitely play around with this! Thanks

Collapse
 
aminmansuri profile image
hidden_dude • Edited

isEmpty would be:

first == last

(note that one space is wasted for isFull() otherwise you wouldn't be able to distinguish if it's full or empty)

Some comments have been hidden by the post's author - find out more