View on GitHub

401-data-structures-and-algorithms

stack-queue-animal-shelter

Create a class called AnimalShelter which holds only dogs and cats. The shelter operates using a first-in, first-out approach. Implement the following methods: enqueue Arguments: animal animal can be either a dog or a cat object. dequeue Arguments: pref pref can be either “dog” or “cat” Return: either a dog or a cat, based on preference. If pref is not “dog” or “cat” then return null

whiteboard

link to whiteboard image

JavaScrip file link to github ➜

Go to table of contents