Data structure, logical structure, and physical structure

Source: Internet
Author: User

What is data structure?

Data structures are widely used terms in computer science and technology. It is used to reflect the internal structure of a data, that is, the way in which a data is composed of those component data.
The structure. Data structures are divided into logical and physical data structures. The logical data structure reflects the logical relationship between component data, while the physical data structure reflects
Storage arrangements within the computing machine. The data structure is the form of data.

Data structure is a way of organizing information. It aims to improve the efficiency of algorithms. It usually corresponds to a set of algorithms, this set of algorithms allows you to perform certain operations on data in the data structure.

What is the main research on data structure?

As a subject, data structure mainly studies various logical structures and storage structures of data, as well as various operations on data. Therefore, there are three main aspects: the logical structure of data, the physical storage structure of data, and operations (or algorithms) on data ). Generally, the design of an algorithm depends on the logical structure of the data. The implementation of an algorithm depends on the physical storage structure of the data.

What is a data structure? What are logical and physical structures?

Data refers to a set of elements composed of finite symbols (such as "0" and "1", with their own structures, operations, and semantics. A structure is a set of relationships between elements. Generally, a Data Structure DS can be expressed as a binary group:

DS = (D, S), // I. e., data-structure = (data-part, logic-structure-part)

Here, D is a set of data elements (or "Node", which may also contain "data items" or "data fields"), and S is defined in D (or another set) set of links on, S = {r | r: D × ...}, it is called the logical structure of elements.

There are four basic types of logical structures: collection structure, linear structure, tree structure, and network structure. Tables and trees are the two most commonly used efficient data structures. Many efficient algorithms can use these two data structures.
Structure to design and implement. A table is a linear (full-order) structure. A tree (partial or hierarchical) and a graph (Partial Order (weak/local orders) are non-linear structures.

The physical structure of the data structure refers to the storage image of the logical structure ). The physical structure P of the data structure DS corresponds to a ing from the data elements of Ds to the storage area M (maintaining the logical structure S): p :( D, S) m

Memory Model: A memory M is a series of fixed-size storage units. Each unit U has a unique address a (u), which is continuously encoded. Each unit U has a unique successor unit u '= succ (u ).

Four basic ing models of P: sequential, linked, indexed, and hashing.

Therefore, we can obtain at least four possible physical data structures:

sequential  (sets)
linked lists
indexed trees
hash graphs

(Not all possible combinations are reasonable)

Data structure operations on DS: All operations defined on DS must maintain the logical and physical structure of DS when changing the data element (node) or node domain.

Basic operations on DS: Any other advanced operations on DS can be implemented using these basic operations. It is best to regard DS and all its basic operations as a whole-called a module. We
This module can be further abstracted as a data type (where the storage structure of DS is expressed as a private member, and basic operations are expressed as a public method), which is called ADT. As an ADT, both stack and queue are non-
All tables have a subset of table operations.

Advanced DATs operations can be designed as (unencapsulated) algorithms and processed by DS using basic operations.

Good and bad DS: If a DS can be converted to a linear DS (such as a linear table) by a certain "linear rule", it is called a good Ds. Good DS usually corresponds to good (high
Algorithm. This is determined by the computing power of the computer, because the computer can only access logical continuous memory units in essence, so how to do not have a linear structure logic is not feasible. For example
To access all nodes in the graph, you must access all nodes in a certain order (to form a partial order ), the fixed nonlinear structure of the image must be converted to a linear structure in some way before
Row operation.

Tree is a good ds-it has very simple and efficient linearity rules, so we can use the tree to design many very efficient algorithms. Tree implementation and use are very simple, but it can solve a lot of problems.
Because of its extraordinary complexity, the tree is the most important and useful data structure in actual programming. The structure of a tree is inherently recursive-each leaf node can be replaced by a subtree, and vice versa. Actual
Each recursive structure can be converted to (or equivalent to) a tree structure.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.