Data Structures: An Explanation of Data Structures

Lain
There are several different forms of data structures. These structures are used in order to provide a method of storing data in a computer is the most efficient way possible. Some of the most common forms of data structures are stacks, queues, trees, and linked lists.

Stacks: The name of this data structure is actually quite self-explanatory. A computer using a stack method stores temporary data in stacks. These stacks store the data in a "last in, first out" method. Picture a stack of blocks. First is the red, then the blue, then the green, and then the yellow. In a stack I place the yellow data last, so the yellow is the first to come out. Adding data to the stack is called "pushing," while removing data from the stack is called "popping." The stack data structure is used with nearly every computer system these days, as well as with programming languages such as Java.

Queues: In contrast to the stack data structure, the queue data structure removes data in the same order as which they were input. Using the example from before, in a queue data structure the red block was put in first and would thus come out first. However, it is also important to note that not all queues are "first in, first out." There is also a queue data structure called a "priority" queue which works on the principle that data is input and removed based on priority.

Tree: The tree is a data structure in which data is attached to one or more of the elements below it. The tree data structure resembles a family tree sort of structure. A tree structure is comprised of root nodes and leave nodes. The root nodes are to be found at the top of the tree structure and are the basis of operation, while the leaf nodes are found at the bottom of the structure as a result of the root nodes. Leaf nodes will not continue the structure, it ends with them so they are always at the bottom of the structure.

Linked Lists: A linked list is an organization of material in a logical manner, however, that manner doesn't have to match up with physical order. Linked lists are lists of nodes linked together. There are several types of linked lists: singly linked lists, doubly linked lists, and circularly linked lists. Linked lists work well for data structures in which data may be added or removed at some point. However, the problem with linked lists is that data cannot be accessed randomly. Instead it must be accessed in order.

Published by Lain

Lain is a University instructor who frequently travels for work and pleasure. She writes on a variety of topics effecting her life and studies including: education, travel, lifestyle, and current entertainm...  View profile

1 Comments

Post a Comment
  • Austin Cooper6/14/2007

    Cool article!

To comment, please sign in to your Yahoo! account, or sign up for a new account.