Of the functionality I included, there was at least one function that I debated on implementing... reverse. Should you be able to reverse a Queue or a Stack? On one hand, after you reverse a queue, it still operates on FIFO, however, none the first element you added will now be the last one you remove, which certainly is not FIFO.
What if I made reverse return a copy of the queue rather than make it in-place?
What do you guys think? Should I keep it or pitch it? What other functions do you think these data structures should have that might not seem obvious?
Also, feel free to lament over stupid implementations of these structures
This post has been edited by atraub: 06 May 2012 - 08:53 PM

New Topic/Question
Reply



MultiQuote









|