11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

396 queueIn an empty queue, the head <strong>and</strong> tail pointers point to the firstcell in memory. To add a value, it is placed at the cell pointed toby the head pointer, <strong>and</strong> the tail pointer is moved up one cell. If anitem is removed, the head <strong>and</strong> tail pointers are moved down oneplace. (Note that items must be added at the tail <strong>and</strong> removed atthe head.)example, chlor<strong>of</strong>orm), would represent one qubit, <strong>and</strong>a large number <strong>of</strong> molecules would be used, for redundancy.Since each “observation” (that is, setting or readingdata) affects only a few <strong>of</strong> the many molecules foreach qubit, the stability <strong>of</strong> the information in the systemis not compromised. However, this approach is limited bythe number <strong>of</strong> atoms in the chosen molecule—perhaps to30 or 40 qubits.There are many potential applications for quantumcomputing. While the technology could be used to crackconventional cryptographic keys, researchers have suggestedthat it could also be used to generate unbreakablekeys that depend on the “entanglement” <strong>of</strong> observers<strong>and</strong> what they observe. The sheer computational power<strong>of</strong> a quantum computer might make it possible to developmuch better computer models <strong>of</strong> complex phenomenasuch as weather, climate, the economy—or <strong>of</strong> quantumbehavior itself.Further ReadingBurda, Ioan. Introduction to Quantum Computation. Boca Raton,Fla.: Universal Publishers, 2005.Kaye, Phillip, Raymond LaFlamme, <strong>and</strong> Michele Mosca. An Introductionto Quantum Computing. New York: Oxford UniversityPress, 2007.Quantum <strong>Computer</strong> News. <strong>Science</strong> Daily. Available online.URL: http://www.sciencedaily.com/news/computers_math/quantum_computers/. Accessed August 17, 2007.West, Jacob. The Quantum <strong>Computer</strong>. Available online. URL: http://www.cs.caltech.edu/~westside/quantum-intro.html. AccessedAugust 17, 2007.queueA queue is basically a “line” <strong>of</strong> items arranged according topriority, much like the customers waiting to check out in asupermarket. Many computer applications involve receiving,tracking, <strong>and</strong> processing requests. For example, an operatingsystem running on a computer with a single processor mustkeep track <strong>of</strong> which application should next receive the processor’sattention. A print spooler holds documents waiting tobe printed. A web or file server must keep track <strong>of</strong> requests forWeb pages, files, or other services. Queues provide an orderlyway to process such requests. Queues can also be used toefficiently store data in memory until it can be processed by arelatively slow device such as a printer (see buffering).As a data structure, a queue is a type <strong>of</strong> list (see listprocessing). New items are inserted at one end <strong>and</strong>removed (deleted) from the other end. This contrasts witha stack, where all insertions <strong>and</strong> deletions are made at thesame end (see stack). Just as the next person served at thesupermarket is the one at the head <strong>of</strong> the line, the end <strong>of</strong> aqueue from which items are removed is called the head orfront. And just as new people arriving at the supermarketline join the end <strong>of</strong> the line, the part <strong>of</strong> the queue wherenew items are added is called the tail or rear. Since the firstitem in line is the first to be removed, a queue is called aFIFO (first in, first out) structure.To create a queue, a program first allocates a block <strong>of</strong>memory. It then sets up to pointers (see pointers <strong>and</strong> indirection).One pointer stores the address <strong>of</strong> the item at thehead <strong>of</strong> the queue; the other has the address <strong>of</strong> the item atthe tail. When the queue starts out, it is empty. This meansthat both the head <strong>and</strong> tail pointer start out pointing to thesame location.A circular queue works in the same way as a “straight” queue,except that when the last cell in the allotted memory block isreached, the pointer or data “wraps around” to the first cell.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!