Hi,
Could someone briefly explain what a queue is and why I would use it instead of an array.
Thanks.
what is a queue
Moderator: General Moderators
So to place things in a queue instead of an array is good if you have to do something with that data that would take up a lot of server resources. To save resources, place them in a queue (in our case, a database) and then schedule, or rotate one after another between them.Dictionary.com/queue wrote: 1. A sequence of stored data or programs awaiting processing.
2. A data structure from which the first item that can be retrieved is the one stored earliest.
The term is also used interchangeably with cache.
A good example of using a cache is when you have to send out multiple thousand of e-mails. Instead of sending them all at the same time, you can cache 75% of the list, and then work through the list in quarters to reduce the server load.Dictionary.com/cache wrote:To hide or store in a cache.
Hope this clears things up.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
-
hokiecsgrad
- Forum Newbie
- Posts: 17
- Joined: Fri Oct 22, 2004 2:55 pm
One of the more important distinctions between an array and a queue, which hasn't specifically been stated yet, is that an array is a random access structure while a queue (and the aforementioned stack) can only be accessed at the "top" or at the "bottom" of the structure.
Basically, queues and stacks are just special types of arrays.
Basically, queues and stacks are just special types of arrays.