Category: 

What is a Data Structure?

Article Details
  • Written By: Gregory Hanson
  • Edited By: Susan Barwick
  • Last Modified Date: 02 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
NASA scientists have discovered a class of stars with atmospheric temperatures cooler than the human body.  more...

December 2 ,  1982 :  The first permanent artificial heart was implanted in a human.  more...

A data structure is a concept from computer science that refers to a particular method of collecting and organizing information. All data structures use information about where a given piece of data is located in the memory of a computer in order to access that data and connect it to other pieces of data. Data structures establish one of many different sorts of relationships between individual pieces of information. Different types of data structure are more efficient for different purposes, and the difficulty of coding varies widely between types of data structure.

Arrays are among the simplest data structures but are nonetheless very powerful tools for organizing information. In an array, elements are assigned sequential memory addresses, allowing the memory address of any item in the array to be determined very rapidly using simple mathematical computations, a key advantage. Arrays can be conceived of as existing in any number of dimensions. A one-dimensional array might be conceptualized as a list, a two-dimensional array as a table, and a three-dimensional array as a cube of individual cells. Arrays of more than three dimensions can exist as well.

Ad

Linked lists are another simple but very important type of data structure. In a linked list, each node consists of a variable containing both actual data and information identifying the next element in the list. A linked list can thus be stepped through so long as the address of the first node is known. This type of data structure is versatile because it lends itself to dynamic growth, as new nodes can easily be assigned at any time. The addition of a variable containing the location of the previous node in the list allows this type of data structure to be traversed in either direction.

Trees order nodes hierarchically, beginning with a root node, and descending through multiple layers of nodes until all necessary data has been accommodated within the structure. Typically, the elements within a tree are sorted in some fashion. Trees may implement sorting and can potentially provide much more rapid access to stored data because of this, as each branching eliminates whole swathes of information from consideration that would need to be sorted through in a linked list.

Hash tables are used to determine a memory address in which a given piece of data is to be stored by using an equation to transform that data into a memory address. They can be a very efficient structure for storing and retrieving data from an array.

All data structures are designed to decrease the number of instructions that a computer must execute in order to locate a particular piece of information. Different types of data lend themselves to different types of data structure, but most modern programming languages offer support for a wide variety of data structure, or provide the tools to allow programmers to code their own data structures.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email