Tuesday, February 24, 2009

Queue

Queue-A queue (pronounced /kjuː/) is a particular kind of collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that whenever an element is added, all elements that were added before have to be removed before the new element can be invoked. A queue is an example of a linear data structure.

Queues provide services in computer science, transport and operations research where various entities such as data, objects, persons, or events are stored and held to be processed later. In these contexts, the queue performs the function of a buffer.

Queues are common in computer programs, where they are implemented as data structures coupled with access routines, as an abstract data structure or in object-oriented languages as classes. Common implementations are circular buffers and linked lists.


Illustration:





Reference:http://en.wikipedia.org/wiki/Queue_(data_structure)

http://images.google.com.ph/images?um=1&hl=en&q=Queue+in+Data+Structure&btnG=Search+Images

Sunday, February 15, 2009

Doubly Linked List

Doubly Linked List-A more sophisticated kind of linked list is a doubly-linked list or two-way linked list. Each node has two links: one points to the previous node, or points to a null value or empty list if it is the first node; and one points to the next, or points to a null value or empty list if it is the final node.

Illustration:


Image:Doubly-linked-list.svg




Reference:

http://en.wikipedia.org/wiki/Linked_list#Doubly-linked_lists

Sunday, February 8, 2009

Stack

stack-is an abstract data type and data structure based on the principle of Last In First Out (LIFO). Stacks are used extensively at every level of a modern computer system. For example, a modern PC uses stacks at the architecture level, which are used in the basic design of an operating system for interrupt handling and operating system function calls. Among other uses, stacks are used to run a Java Virtual Machine, and the Java language itself has a class called "Stack", which can be used by the programmer. The stack is ubiquitous.A stack is a homogeneous collection of items of any one type, arranged linearly with access at one end only, called the top. This means that data can be added or removed from only the top. Formally this type of stack is called a Last In, First Out (LIFO) stack. Data is added to the stack using the Push operation, and removed using the Pop operation.
Illustation:















Reference:http://en.wikipedia.org/wiki/Stack_(data_structure)
http://www.cs.usask.ca/content/resources/tutorials/csconcepts/1998_5/stacks/1-1.html