Quack provides us with a cutting edge, top of the line, way to deal with data! How does it do that you might ask? Well, lets just take a look at it's name real quick...
Quack = Queue + Stack
You heard that right! This data structure behaves exactly like a queue and a stack! The only caviat... the programmer has no control over the behavior of the quack!
The quack has 3 different behaviors chosen at pseudo-random! Let's look at each one of those!
One of the random behaviors the quack invokes is to act like a queue! In this case, when you pop something off the quack, it will grab the first item in the quack! FIFO for dayzzzzzz.
And to help the programmer know that the quack acted as a Queue, it will print out the word "Quack!", just so you know!
The second behavior the quack has is to act like a stack! In this case we just grab the item that was most recently put in the quack! FILO boyyyyy!
Again, to aid the programmer in their endevors, I have programmed the quack to print out "quack!" to identify that a stack operation had just been done!
The third and final behavior for our Quack is to become a gray duck! What does this do? Well, it doesn't pop anything off the quack at all! And in fact, it returns a pseudo-randomly generated number for your use! Isn't that nice! I have decided to create a new acronym for this case... AINO (All In None Out)!
And again, just so you know that you have been Gray Ducked, the quack will print out "qUAcK?" to inform you that you are a victim of misfortune.
You shouldn't.
I was bored.
I don't know, I'm kind of lazy.
Good enough to create a frankenstein data structure that is utterly useless.
Maybe.
Of course.
Because even I don't know what it is doing.