Tuesday, September 06, 2005

Well... into the semester comes array stacks and circular queues. Made a nifty java application that visualizes (in a really cute way) circular queues. get it from here:

Afterwards ME25 and 26, CDStack class and SongQueue class. The CDStack simulates a stack of CDs. Of course you could only get and put CDs at the top, so what if you want to get a CD in the middle?

The SongQueue class has methods currentlyPlaying(), insertSong and nextSong(). This forced them to use the Queue algorithm on objects instead of primitive data types, showing that the algo works for whatever datatype.

One of the things about these two classes is that i asked them not to reimplement stacks and queues for their program. They have to reuse the existing stack and queue implementation (small changes only). They are to use Stacks and Queues as an abstract datatype without having to worry about how storage is implemented inside.


Post a Comment

<< Home