Data structure

format_list_bulleted Contenido keyboard_arrow_down
ImprimirCitar
Example of hash board.

In computer science, a data structure is a particular way of organizing information in a computer so that it can be used efficiently. Different types of data structures are suitable for different types of applications, and some are highly specialized for specific tasks.

Data structures are means of handling large amounts of information efficiently for uses such as large databases and Internet indexing services. Usually, efficient data structures are key to designing efficient algorithms. Some formal methods of programming language design emphasize data structures, rather than algorithms, as the key organizing factor in software design. More precisely, a data structure is a collection of values, the relationships between them, and the functions and operations that can be applied to the data. That is, it is an algebraic structure on data.

Description

Data structures are generally based on a computer's ability to retrieve and store data anywhere in its memory.

Types of data structures

Data structures can be of different types, depending on the technique used for their storage and recovery, these types are the following:

  • Static data structure.
  • Dynamic data structure.

According to the sequence that is presented between each element at the moment of making the journey between the elements of the data structure, it can be classified into the following types:

  • Linear data structure.
  • Nonlinear data structure.

Examples

Python 3. The standard type hierarchy.png

There are numerous types of data structures, generally built on top of simpler ones:

  • A vector is a series of elements in a specific order, usually all of the same type (although the elements can be of almost any type). The elements are accessed using an integer as an index to specify the element required. Typical implementations assign contiguous memory words to the elements of the arrangements (although not always the case). The arrangements can change in size or have a fixed length.
  • An Associative Vector (also called dictionary or map) is a more flexible variant than a matrix, in which you can freely add and remove name-value pairs. A hash table is an usual implementation of an associative arrangement.
  • A log (also called or structure) is an aggregate data structure. A record is a value that contains other values, typically in a fixed number and sequence and usually an index by names. Records elements are usually called fields or cells.
  • A binding is a data structure that specifies which of a series of allowed data types can be stored in your instances, for example floating or Long. In contrast to a record, which could be defined to contain a floating and one LongIn a union there is only one value at a time. Enough space is allocated to contain the type of data of any member.
  • A variant type (also called variant or Discrimination) contains an additional field indicating its current type.
  • A set is a type of abstract data that can store specific values, without particular order and without duplicate values.
  • A multiset is a type of abstract data that can store specific values, without particular order. Unlike sets, multisets admit repetitions.
  • A graph is a data structure connected by nodes. Each node contains a value and one or more references to other nodes. Graphs can be used to represent networks, since nodes can be referenced among them. The connections between nodes may have direction, i.e. a departure node and a arrival.
  • A tree is a particular case of graphite directed in which no cycles are allowed and there is a path from a node called root to each of the other nodes. A collection of trees is called a forest.
  • A class is a template for the creation of data objects according to a predefined model. Classes are used as abstract representation of concepts, including fields such as records and operations that can consult the value of the fields or change their values.

Language support

Most assembly languages and some low-level languages, such as BCPL, lack data structure support. Instead, many high-level languages and some high-level assembly languages, such as MASM, have some built-in support for certain data structures, such as registers and arrays. For example, the C and Pascal languages support structures and registers, respectively, as well as multidimensional arrays and arrays.

Most programming languages have some kind of library or mechanism that allows the use of data structures in programs. Modern languages usually come with standard libraries that implement the most common data structures. Examples are the C++ Standard Template Library, the Java collections, and the Microsoft.NET libraries.

Data structures in programming

In programming, a data structure can be declared initially by writing a keyword, then an identifier for the structure and a name for each of its members, not forgetting the data types they represent. Generally, each member is separated by some kind of operator, character, or reserved word.

In the Pascal programming language, it is possible to create a data structure in the above way. The basic syntax is:

 Estruct Identifier, _
Member1:TypeDeDato, _
Member2:TypeDeDato, _
...
Member9:DeDatoType

To access the members of a structure, you must first create a reference to it, usually with a variable of type; then you can edit and get the member data freely.

 Estruc Structure,Member1:Entero,Member2:Cadena,Member3:Byte
 Var Variable:
Variable.Member1 = 40000
Variable.Member2 = "Hello World"
Variable.Member3 = 255
Message(Variable.Member2) 'Show "Hello World"

Contenido relacionado

Global system for mobile communications

The global system for 2G mobile communications is a standard system, developed by the European Telecommunications Standards Institute royalty-free, for...

Hexadecimal system

In principle, since the usual numeral system is decimal based and, therefore, only ten digits are available, the convention of using the first six letters of...

Redhat

Red Hat, Inc. is an American multinational software company that provides open source software primarily to businesses. Founded in 1993, Red Hat is...
Más resultados...
Tamaño del texto:
undoredo
format_boldformat_italicformat_underlinedstrikethrough_ssuperscriptsubscriptlink
save