Queue Class
Peter Eliades - MDIS
We needed to implement a Queue recently and we thought what a good way to stay with classes.
As with the Stack class last issue, this queue class is a pretty trivial example. It has only four methods and one property -
| * Methods: | ||
| Queue.Insert <Item> | To insert item in queue | |
| <Item>= Queue.Remove | To remove item from queue | |
| <Item>= Queue.View | View but do not remove item from queue | |
| Queue.Clear | Remove all item from queue | |
| * Properties: | ||
| Queue.Size | Contains no. of items in queue |
As you will see from the code the queue is self sizing so you will never run out of space.
It may be simple, but it's already served us well a few times. Reusability is King.......
If you wish to use it.... use it wisely. <g>